Skip to content

fix(theme): ignored files in the explorer meet 4.5:1 in the built-in themes - #37355

Merged
nwparker merged 1 commit into
mainfrom
nwparker/theme-ignored-contrast
Nov 2, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/theme-ignored-contrast

Conversation

@nwparker

@nwparker nwparker commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3 0

Summary

Git-ignored files in the File Explorer are drawn in italic --git-decoration-ignored. The built-in values were #8c8c8c (light) and #6e6e6e (dark), which is 3.22:1 and 3.52:1 against the explorer surface (--sidebar). Both are below WCAG AA for text (4.5:1), so an ignored folder you work in every day was hard to read.

Root cause: the two built-in token values, nothing else. The fix raises only those values, to the smallest grey step that meets 4.5:1 on the explorer surface:

Theme Before After Ratio on --sidebar before → after Still dimmer than
Light #8c8c8c #737373 3.22 → 4.54 muted text #696969 (5.26), normal text #0a0a0a (18.97)
Dark #6e6e6e #808080 3.52 → 4.54 muted text #acacac (7.90), normal text #f0f0f0 (15.73)

One step smaller fails in both themes: #747474 is 4.48:1 and #7f7f7f is 4.48:1.

Themes that set --git-decoration-ignored keep their own value. The plugin theme pipeline paints it inline on the root, which overrides these class defaults, and the theme contrast gate is unchanged. Theme plugins can set the token (#36578), and that's the supported route for anyone who wants a different look. As requested in the triage, no new setting was added. The existing theme-token-contrast.test.ts now also guards this pair against regressing. A stale comment in plugin-theme-tokens.ts cited the old 3.3:1 built-in value and is updated.

Closes #35910

Contrast, measured in the running app

These were computed from rendered colors in a dev build on a throwaway profile, driven over CDP. The row is output/ in a repo that ignores it.

Mode Surface Before After
Light #fafafa 3.22 4.54
Dark #171717 3.52 4.54
Match Terminal, light (Tango Light) #ffffff 3.36 4.74
Match Terminal, dark (Ghostty Default Dark) #282c34 2.75 3.54 (improved, still under 4.5; see tradeoffs)

Visual proof (File Explorer, output/ and debug.log are ignored)

Before After
Light before light after light
Dark before dark after dark
Match Terminal light before mt light after mt light
Match Terminal dark before mt dark after mt dark

Merge-risk assessment: Low

  • Two hex values in main.css, one comment, and one test row. No schema, settings, IPC or migration changes.
  • The token's only readers are FileExplorerRow.tsx (the name and the ignored icon). No mobile, docs or other copies of these hex values exist.
  • Plugin themes that set the token are unaffected. Mixed client/server versions don't matter, because this is renderer CSS only.

Negative user-facing tradeoffs

  • Ignored files look slightly less dim than before, so they stand out a little less from tracked files. They still read clearly dimmer than both muted and normal text.
  • 4.5:1 holds on the resting row only. Hovered rows paint --accent: light is 4.35:1 (was 3.08) and dark is 2.63:1 (was 2.03). Reaching 4.5:1 on dark hover would need about #9a9a9a, which no longer reads as dimmed, so I left that out of scope.
  • Match Terminal derives its surfaces from the terminal theme and does not set this token. On a dark terminal background like #282c34, ignored text improves from 2.75 to 3.54 but stays under 4.5:1.

Validation

  • pnpm test src/renderer/src/assets/theme-token-contrast.test.ts passes (16 tests, including the new ignored/sidebar pair in light and dark).
  • oxlint and pnpm format are clean (run by the pre-commit hook).
  • Real app: ORCA_BACKGROUND_LAUNCH=1 dev build, CDP port 9361, throwaway HOME and user-data dir. I added a demo repo whose .gitignore ignores output/ and *.log, then measured and screenshotted Light, Dark, and Match Terminal light/dark on origin/main and on this branch.
  • Review: an Opus sub-agent review confirmed the values are the smallest passing step, there are no other consumers or copies, and plugin overrides still win. It flagged hover contrast, which is now documented above. Codex (gpt-6.1-sol, xhigh) reported no correctness, perf, cross-platform or back-compat findings.

Perf

  • Scanned: the full diff vs origin/main (perf-scan questions 1–6). The only runtime change is two CSS custom-property values that are already declared, so there are no new selectors, declarations, rules, subscriptions or work of any kind. Style recalculation is unchanged: the same token, read by the same rule, with the same invalidation.
  • Bundle: the CSS byte size is identical (hex values of the same length).
  • Findings: none.

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f37c2e42-a918-4d6b-a91e-db6e13d800c0
Commits

Reviewing files that changed from the base of the PR and between 0f6a572 and 9484332.

Files selected for processing: 3
  • src/renderer/src/assets/main.css
  • src/renderer/src/assets/theme-token-contrast.test.ts
  • src/renderer/src/lib/plugin-theme-tokens.ts
Walkthrough

The light and dark theme values for --git-decoration-ignored change. The contrast-pair test adds a check against --sidebar. A comment clarifies that status hues tint file names while the theme’s Git palette remains effective.

Severity of issue fixed: Low

Merge Risk: Minimal · previous review 0f6a5

The token updates and contrast checks introduce no established merge-blocking risk.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title names the main change: the built-in ignored-file token in the explorer is raised so ignored files meet 4.5:1 contrast in the built-in themes. The changeset matches this. It edits the two tok…
Description check Passed The description follows the template well. It has a Summary with root cause, What Changed in a before/after table, Why (the WCAG contrast problem and the alternatives considered), a linked issue (Clos…
Linked Issues check Passed Issue #35910 requires Git-ignored items to remain visible and become easier to read. The PR raises the built-in --git-decoration-ignored values from #8c8c8c to #737373 in light theme and from `#…
Out of Scope Changes check Passed The changes are limited to the two built-in token values, one related comment, and contrast tests. The comment and tests support the contrast objective. The PR does not add unrelated settings, schema …
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Title check

Explanation

The title names the main change: the built-in ignored-file token in the explorer is raised so ignored files meet 4.5:1 contrast in the built-in themes. The changeset matches this. It edits the two token values in main.css, adds an ignored/sidebar contrast pair to the test, and updates a comment.

Full details: Description check

Explanation

The description follows the template well. It has a Summary with root cause, What Changed in a before/after table, Why (the WCAG contrast problem and the alternatives considered), a linked issue (Closes #35910), visual proof for before and after in light and dark, testing steps and results, a merge-risk assessment with a Low level, and negative tradeoffs. It omits the ELI5 section, the explicit Testing platform list, the Risk backout instructions, the AI Disclosure, and the checklist, and it does not fill in the Review and Agent skill sections. These gaps are non-critical, so the description is mostly complete.

Full details: Linked Issues check

Explanation

Issue #35910 requires Git-ignored items to remain visible and become easier to read. The PR raises the built-in --git-decoration-ignored values from #8c8c8c to #737373 in light theme and from #6e6e6e to #808080 in dark theme. The reported contrast reaches 4.54:1 against --sidebar. The added theme-token-contrast.test.ts checks cover both themes. The implementation uses the issue's proposed default-value approach and does not require a new setting.

Full details: Out of Scope Changes check

Explanation

The changes are limited to the two built-in token values, one related comment, and contrast tests. The comment and tests support the contrast objective. The PR does not add unrelated settings, schema changes, IPC changes, migrations, or unrelated product behavior. The documented hover and Match Terminal limitations remain outside the stated objective.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files. (1 skipped: 1 unsupported.)

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional comments: 1
src/renderer/src/lib/plugin-theme-tokens.ts-23-23: 1

23-23: Minor · Maintainability & Code Quality · Quick win

Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Correct the contrast rationale.

--git-decoration-ignored also colors the CircleSlash icon in src/renderer/src/components/right-sidebar/FileExplorerRow.tsx:264-272, not only file names. Update this comment to mention filenames and status icons, or state the non-text contrast rationale. (raw.githubusercontent.com)


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2c129bbb-6d3c-47c7-95a2-c3d2e81bf1a6
Commits

Reviewing files that changed from the base of the PR and between 60e25bd and 0f6a572.

Files selected for processing: 3
  • src/renderer/src/assets/main.css
  • src/renderer/src/assets/theme-token-contrast.test.ts
  • src/renderer/src/lib/plugin-theme-tokens.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

@nwparker
nwparker force-pushed the nwparker/theme-ignored-contrast branch from 0f6a572 to 9484332 Compare November 2, 2026 06:34
@nwparker
nwparker merged commit e7575e5 into main Nov 2, 2026
42 checks passed
@nwparker
nwparker deleted the nwparker/theme-ignored-contrast branch November 2, 2026 08:11
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.

[Feature]: Ignored files in File Explorer are hard to read in dark theme (low contrast #6e6e6e) — allow customizing

1 participant