Repository navigation
Conversation
|
Warning Review limit reached
Next review available in: 1 minute Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between 362fdeecb52775c7a86b0d2798d139ee42303913 and 3f66cdd. 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds a new 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/renderer/src/components/settings/TerminalRenderingSection.tsx (1)
27-30: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winReplace fragile
searchEntries[1]index access with inline values.The magic index
1silently selects the wrong entry if the catalog is ever reordered. Additionally,contrastEntry?.keywordspulls in translated keywords fromtranslateSearchKeyword, which conflicts with the convention of using English-only keywords inSearchableSettingfor consistency across panes — the GPU AccelerationSearchableSettingabove hardcodes English keywords directly.Consider removing
contrastEntryentirely and inlining thedescriptionviatranslate()and thekeywordsas an English-only array, matching the existing pattern.♻️ Proposed refactor
- const searchEntries = getTerminalRenderingSearchEntries() - // Why index 1: catalog order is GPU Acceleration, then Minimum Contrast Ratio. - const contrastEntry = searchEntries[1] - return ( <section key="rendering" className="space-y-3">And in the
SearchableSetting:description={ - contrastEntry?.description ?? translate( 'auto.components.settings.TerminalPane.minimumContrastRatio.description', 'Raises low-contrast ANSI text toward the background until this ratio is met. Set to 1 to use theme colors as-is.' ) } - keywords={ - contrastEntry?.keywords ?? [ - 'terminal', - 'contrast', - 'color', - 'ansi', - 'minimum contrast', - 'colors', - 'xterm' - ] - } + keywords={[ + 'terminal', + 'contrast', + 'color', + 'ansi', + 'minimum contrast', + 'colors', + 'xterm' + ]}Based on learnings,
keywordsarrays inSearchableSettingshould intentionally remain untranslated/English for consistency with other panes.Source: Learnings
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: fc09c0dd-ecd8-4aa7-ad05-5472479a27a5
📥 Commits
Reviewing files that changed from the base of the PR and between 6fb3036 and 183404969e3fde3ef190984a275e77933632fdd3.
📒 Files selected for processing (12)
src/main/codex-accounts/runtime-home-service.test.tssrc/main/codex-accounts/service.test.tssrc/renderer/src/components/settings/TerminalRenderingSection.tsxsrc/renderer/src/components/settings/TerminalSettingsPreview.tsxsrc/renderer/src/components/settings/setting-labels.tssrc/renderer/src/components/settings/terminal-typography-search.tssrc/renderer/src/components/terminal-pane/terminal-appearance.tssrc/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.tssrc/renderer/src/lib/pane-manager/pane-lifecycle.test.tssrc/renderer/src/lib/pane-manager/pane-terminal-options.tssrc/shared/constants.tssrc/shared/types.ts
|
Resolved merge conflict with main (#8050 line-height normalize). Kept main's |
362fdee to
9bc5f74
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review Please review current head 3f66cdd after the exact-head CI discovered and fixed a stale full-module mock in TerminalSettingsPreview.lifecycle.test.tsx. |
|
✅ Action performedReview finished.
|
3f66cdd to
f40ff75
Compare
xterm's minimumContrastRatio default of 4.5 can rewrite theme ANSI colors. Expose Settings → Terminal → Rendering control (1–21, default 4.5) so users can set 1 for true theme colors while keeping the accessibility default. Fixes stablyai#7934
f40ff75 to
b790abd
Compare
|
reviewing |
|
Thanks a lot for this, @bbingz — the analysis in the summary is spot on, and the configurable implementation is clean. After thinking it through, we're going to go a slightly different direction: instead of a user setting, gate the contrast enforcement by theme mode automatically — keep Because of that, I'm going to close this in favor of a new PR that takes the theme-gated approach — coming soon, will link it here. Really appreciate the work and the write-up; it directly shaped the decision. |
|
Thanks for the thoughtful follow-up! That direction makes sense to me: keeping 4.5 for light themes while disabling contrast enforcement for dark themes addresses both the original visibility issue and color fidelity without adding another setting. I am glad the analysis and implementation helped shape the decision. Looking forward to the follow-up PR, and happy to help review or test it. |
…luminance (#7934) (#9599) * fix(terminal): gate xterm contrast correction by theme mode (#7934) minimumContrastRatio: 4.5 (added in #5986 to rescue invisible white/bright-white ANSI text on light backgrounds) was applied globally, over-correcting vibrant ANSI colors on dark themes. Keep 4.5 on light themes; disable it (1) on dark themes. applyTerminalAppearance re-gates it in its per-pane loop, so live auto/system dark<->light flips are handled for free. buildDefaultTerminalOptions keeps 4.5 as the initial value so the first paint on a light theme never flashes low-contrast text. Supersedes #7939. Co-authored-by: Orca <[email protected]> * fix(terminal): gate contrast correction by terminal background luminance Contrast correction rescues white text on light backgrounds but over-corrects on dark. The previous mode-based gate failed when the terminal theme didn't match the app mode (e.g., terminalUseSeparateLightTheme=false). Now gates by the theme's background luminance via isTerminalBackgroundLight() instead. * refactor(terminal): extract contrast correction gating into shared helpe Centralizes the minimumContrastRatio gating logic (#7934) into a dedicated module so both the settings preview and live terminal appearance apply the same contrast-by-luminance rule, preventing drift. Adds value-gating to skip redundant writes that would clear xterm's contrast cache on re-applies. --------- Co-authored-by: Orca <[email protected]>
…luminance (stablyai#7934) (stablyai#9599) * fix(terminal): gate xterm contrast correction by theme mode (stablyai#7934) minimumContrastRatio: 4.5 (added in stablyai#5986 to rescue invisible white/bright-white ANSI text on light backgrounds) was applied globally, over-correcting vibrant ANSI colors on dark themes. Keep 4.5 on light themes; disable it (1) on dark themes. applyTerminalAppearance re-gates it in its per-pane loop, so live auto/system dark<->light flips are handled for free. buildDefaultTerminalOptions keeps 4.5 as the initial value so the first paint on a light theme never flashes low-contrast text. Supersedes stablyai#7939. Co-authored-by: Orca <[email protected]> * fix(terminal): gate contrast correction by terminal background luminance Contrast correction rescues white text on light backgrounds but over-corrects on dark. The previous mode-based gate failed when the terminal theme didn't match the app mode (e.g., terminalUseSeparateLightTheme=false). Now gates by the theme's background luminance via isTerminalBackgroundLight() instead. * refactor(terminal): extract contrast correction gating into shared helpe Centralizes the minimumContrastRatio gating logic (stablyai#7934) into a dedicated module so both the settings preview and live terminal appearance apply the same contrast-by-luminance rule, preventing drift. Adds value-gating to skip redundant writes that would clear xterm's contrast cache on re-applies. --------- Co-authored-by: Orca <[email protected]>
Summary
Makes xterm
minimumContrastRatiouser-configurable (issue #7934).The hardcoded
4.5inpane-terminal-options.tsboosts low-contrast ANSI text for accessibility, but can rewrite carefully chosen theme colors. Users can now set 1 (no correction) through 21 under Settings → Terminal → Rendering.Test plan
vitestpane-lifecycle normalize/default teststypecheck:tsc:node1; confirm theme colors render without boost4.5; low-contrast white-on-light still readableFixes #7934