Repository navigation
Conversation
|
Warning Review limit reachedYou'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 1 minute. View limit details
Walkthrough
🚥 Pre-merge checks | ✅ 3 | ❌ 2
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.
Actionable comments posted: 3
🧹 Nitpick comments (3)
src/shared/terminal-color-overrides.test.ts (1)
1-9: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winMissing coverage for
mergeImportedTerminalColorOverrides.No test in this suite exercises
mergeImportedTerminalColorOverrides(imported byuseGhosttyImport.ts/ThemeStep.tsx). A test seeding only the legacyterminalColorOverridesbag and asserting the resulting overrides don't leak into the other mode after resolution would have caught the mode-scoping gap flagged inuseGhosttyImport.ts/ThemeStep.tsx.src/renderer/src/components/settings/TerminalColorOverridesSection.tsx (2)
43-52: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCollapse toggle lacks
aria-expanded.The disclosure
<button>togglingexpandeddoesn't expose its state to assistive tech.♿ Proposed fix
<button onClick={() => setExpanded((prev) => !prev)} className="flex items-center gap-2 text-sm font-medium" + aria-expanded={expanded} >
31-38: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winNew locale keys deviate from the established hash-based convention in this namespace.
Every neighboring key in the
TerminalWindowSectionnamespace here uses the 10-char hash format (63f8d9336e,03c855d15f), but the new keys (color_overrides_mode_description,color_overrides_mode_title,color_overrides_mode_aria,color_overrides_match_dark_hint) are semantic slugs, and they're also namespaced underTerminalWindowSectiondespite living in the newTerminalColorOverridesSection.tsxfile.Based on learnings, semantic keys are acceptable only "when they match the established neighboring namespaces," which isn't the case here; the codebase otherwise "use[s] hash-based locale keys with
translate('auto.components.<Dir>.<ComponentFile>.<10-char-hash>', ...)" for settings components.Also applies to: 61-64, 69-72, 93-96
Source: Learnings
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: cc5e6948-058e-437d-9705-20e913c88585
📒 Files selected for processing (15)
src/renderer/src/components/dashboard-popout/AgentTerminalPreview.tsxsrc/renderer/src/components/onboarding/ThemeStep.tsxsrc/renderer/src/components/settings/TerminalColorOverridesSection.tsxsrc/renderer/src/components/settings/TerminalSettingsPreview.tsxsrc/renderer/src/components/settings/TerminalWindowSection.tsxsrc/renderer/src/components/settings/setting-labels.tssrc/renderer/src/components/settings/useGhosttyImport.tssrc/renderer/src/components/terminal-pane/TerminalPane.tsxsrc/renderer/src/components/terminal-pane/compose-active-terminal-theme.test.tssrc/renderer/src/components/terminal-pane/terminal-appearance.tssrc/renderer/src/lib/left-sidebar-appearance.tssrc/renderer/src/runtime/sync-runtime-graph.tssrc/shared/terminal-color-overrides.test.tssrc/shared/terminal-color-overrides.tssrc/shared/types.ts
Sync update (
|
Color Overrides previously lived in a single terminalColorOverrides bag, so a dark-mode background tweak also painted light mode. Keep the legacy bag for backward compatibility, add mode-specific dark/light bags, and resolve the active bag from the terminal appearance mode (with Match dark mode reuse). Closes stablyai#10561
Reset label names the active mode; Ghostty import seeds dark-only; edits/resets target the effective bag when light matches dark.
2cbca27 to
5d97a18
Compare
[Medium impact] The change reaches terminal colors across the app. Fix the saved-color resolver and plugin theme application before merging. FindingsSummaryThis PR adds separate dark and light terminal color overrides, updates terminal views and previews, and adds a mode control in Settings.
|
| return { | ||
| terminalColorOverrides: undefined, | ||
| terminalColorOverridesDark: effectiveMode === 'dark' ? compactOverrides(seeded) : undefined, | ||
| terminalColorOverridesLight: effectiveMode === 'light' ? compactOverrides(seeded) : undefined |
There was a problem hiding this comment.
The first per-mode edit clears terminalColorOverrides, but resolveConfiguredTerminalColors still reads only that old field. Native chat with “match terminal” enabled then loses the user's colors. Hosts without a viewer also answer OSC 10/11 with the base theme instead of the saved overrides.
Update that shared resolver and its callers to pass and resolve both new fields.
| const colorOverrides = resolveTerminalColorOverridesForMode(settings, mode) | ||
| if (colorOverrides) { | ||
| theme = { ...theme, ...colorOverrides } |
There was a problem hiding this comment.
Old colors cover plugin themes
After a per-mode edit or Ghostty import, applying a plugin terminal theme leaves the old overrides covering its colors. terminalThemeUpdate clears only terminalColorOverrides, while this merge keeps applying terminalColorOverridesDark or terminalColorOverridesLight over the selected theme.
Update plugin theme application to clear the affected per-mode overrides and save them for “Switch back.”
| {translate( | ||
| 'auto.components.settings.TerminalWindowSection.03c855d15f', | ||
| 'Reset {{value0}} color overrides', | ||
| { value0: mode } |
There was a problem hiding this comment.
The button reuses a translation key whose existing translations say “Reset all color overrides.” Those translations replace the new fallback, so non-English users are told the button resets both modes even though it resets only the effective selected mode.
Update the translations or use a new key with the mode placeholder.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
Thanks. Closing this in favour of #36581. That PR keeps the #10561 outcome: color overrides belong to a theme slot, and light mode that matches dark still reuses the dark bag. Keeping the original key as the dark slot, resolving the palette in one place, and reusing the existing Dark/Light target avoid a second control and a second stored key. I will not keep this branch competing on the same readers. |

Summary
terminalColorOverrides), so a dark-mode background override also covered light mode ([Bug]: Appearance terminal color overrides affects both light/dark mode #10561).terminalColorOverridesDark/terminalColorOverridesLight, keep the legacy bag until the first per-mode edit, and resolve overrides from the effective terminal appearance mode (light “Match dark mode” reuses the dark bag).Test plan
vitest—terminal-color-overrides,compose-active-terminal-theme,useGhosttyImport,left-sidebar-appearanceCloses #10561
ELI5
Terminal color overrides applied to both light and dark modes together, so a dark background tweak broke light mode. Overrides are per light/dark mode with a clear Settings control.