Skip to content

refactor: remove unused withTransparentBackground theme helper#511

Merged
benvinegar merged 1 commit into
mainfrom
chore/remove-transparent-background-helper
Jul 3, 2026
Merged

refactor: remove unused withTransparentBackground theme helper#511
benvinegar merged 1 commit into
mainfrom
chore/remove-transparent-background-helper

Conversation

@benvinegar

Copy link
Copy Markdown
Member

What

Follow-up to #510. Once the interactive TUI switched to withTransparentSurfaces, withTransparentBackground had no production callers left — only its own unit test and one pierre renderer test. Per the repo rule of removing dead paths:

  • Delete withTransparentBackground from src/ui/themes.ts and its dedicated unit test.
  • Update the withTransparentSurfaces JSDoc, which still claimed only static pager hosts used it.
  • Rewrite the pierre word-diff test to build transparent tints inline. The renderer guard it covers (resolveWordDiffHighlightBg refusing to blend transparent values into black) is still live production behavior, because custom themes can declare "transparent" colors directly.

Empty changeset — internal cleanup, no user-visible change.

🤖 Generated with Claude Code

After #510 switched the interactive TUI to withTransparentSurfaces, the
fully-transparent helper had no production callers left. Remove it and
rewrite the pierre word-diff test to build transparent tints inline,
since custom themes can still declare "transparent" colors that the
renderer must keep out of blend math.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR removes the dead withTransparentBackground theme helper after the interactive TUI migrated to withTransparentSurfaces in #510, leaving the helper with no production callers. The JSDoc for withTransparentSurfaces is updated to reflect that both the TUI and static pager hosts now use it.

  • Deletes withTransparentBackground from src/ui/themes.ts and its dedicated unit test, with no remaining references anywhere in the codebase.
  • Rewrites the pierre word-diff test to inline only the four transparent tint fields it actually needs, making the test's intent clearer and removing the dependency on the deleted helper.
  • Adds an empty changeset to mark this as an internal-only change with no user-visible effect.

Confidence Score: 5/5

Safe to merge — removes dead code with no remaining callers and no user-visible behavior change.

The deleted helper had zero production callers after #510; grep confirms no remaining references anywhere. The pierre test now covers the same renderer guard with a more focused inline fixture. The JSDoc update is accurate.

No files require special attention.

Important Files Changed

Filename Overview
src/ui/themes.ts Removes withTransparentBackground and updates the withTransparentSurfaces JSDoc — clean deletion with no remaining callers.
src/ui/themes.test.ts Removes the withTransparentBackground unit test and its import; remaining tests are unaffected.
src/ui/diff/pierre.test.ts Rewrites the transparent word-diff test to inline only the four relevant tint fields; the guard under test (resolveWordDiffHighlightBg) is still exercised correctly.
.changeset/remove-transparent-background-helper.md Empty changeset entry, correctly signals no user-visible package version bump for this internal cleanup.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[AppTheme] --> B[withTransparentSurfaces]
    B --> C["Clears neutral surfaces\n(background, panel, panelAlt,\ncontextBg, contextContentBg, lineNumberBg)"]
    C --> D["Keeps semantic tints\n(addedBg, removedBg,\naddedContentBg, removedContentBg)"]
    D --> E[Interactive TUI]
    D --> F[Static Pager Hosts]

    G["withTransparentBackground\n(deleted)"] -.->|"was: clears ALL surfaces\nincluding semantic tints"| X["No callers remain"]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[AppTheme] --> B[withTransparentSurfaces]
    B --> C["Clears neutral surfaces\n(background, panel, panelAlt,\ncontextBg, contextContentBg, lineNumberBg)"]
    C --> D["Keeps semantic tints\n(addedBg, removedBg,\naddedContentBg, removedContentBg)"]
    D --> E[Interactive TUI]
    D --> F[Static Pager Hosts]

    G["withTransparentBackground\n(deleted)"] -.->|"was: clears ALL surfaces\nincluding semantic tints"| X["No callers remain"]
Loading

Reviews (1): Last reviewed commit: "refactor: remove unused withTransparentB..." | Re-trigger Greptile

@benvinegar benvinegar merged commit 05f8ac8 into main Jul 3, 2026
9 checks passed
@benvinegar benvinegar deleted the chore/remove-transparent-background-helper branch July 3, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant