Repository navigation
fix(terminal): reduce inactive pane dimming - #11591
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe inactive terminal pane opacity default is centralized in ✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
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 |
| it('keeps inactive terminal panes readable by default', () => { | ||
| expect(getDefaultSettings('/tmp').terminalInactivePaneOpacity).toBe( | ||
| DEFAULT_TERMINAL_INACTIVE_PANE_OPACITY | ||
| ) | ||
| }) |
There was a problem hiding this comment.
Test is tautological — won't catch a value regression
Because getDefaultSettings is implemented by reading DEFAULT_TERMINAL_INACTIVE_PANE_OPACITY directly, this assertion is always true regardless of what numeric value the constant holds. If someone later accidentally sets the constant to 0.5, the test still passes. Pinning the assertion to a concrete value (e.g. toBe(0.9)) would give the test independent verification power.
| it('keeps inactive terminal panes readable by default', () => { | |
| expect(getDefaultSettings('/tmp').terminalInactivePaneOpacity).toBe( | |
| DEFAULT_TERMINAL_INACTIVE_PANE_OPACITY | |
| ) | |
| }) | |
| it('keeps inactive terminal panes readable by default', () => { | |
| expect(DEFAULT_TERMINAL_INACTIVE_PANE_OPACITY).toBe(0.9) | |
| expect(getDefaultSettings('/tmp').terminalInactivePaneOpacity).toBe( | |
| DEFAULT_TERMINAL_INACTIVE_PANE_OPACITY | |
| ) | |
| }) |
Greptile SummaryThis PR raises the default inactive terminal pane opacity from
Confidence Score: 4/5Safe to merge — the change is a small, well-contained default value bump with a single source of truth for the new constant. All three files are consistent: the constant is defined once, consumed by both the default-settings factory and the UI component, and covered by a new test. The only weakness is that the test compares Files Needing Attention: constants.test.ts — the new test assertion should pin the concrete value 0.9 to provide independent coverage of the constant itself.
|
| Filename | Overview |
|---|---|
| src/shared/constants.ts | Introduces DEFAULT_TERMINAL_INACTIVE_PANE_OPACITY = 0.9 and replaces the inline 0.8 literal in getDefaultSettings — clean single-source-of-truth extraction. |
| src/renderer/src/components/settings/TerminalPaneAppearanceSection.tsx | Replaces hardcoded 0.8 with the newly exported constant so the settings UI default label stays in sync with the persisted default. |
| src/shared/constants.test.ts | Adds a regression test for the new default, but the assertion compares getDefaultSettings output against the same constant it reads internally, making it unable to detect a numeric value drift. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[constants.ts
DEFAULT_TERMINAL_INACTIVE_PANE_OPACITY = 0.9] --> B[getDefaultSettings
terminalInactivePaneOpacity: DEFAULT_TERMINAL_INACTIVE_PANE_OPACITY]
A --> C[TerminalPaneAppearanceSection
NumberField defaultValue=DEFAULT_TERMINAL_INACTIVE_PANE_OPACITY]
B --> D[(Persisted GlobalSettings
terminalInactivePaneOpacity)]
D --> E[resolvePaneStyleOptions
paneStyleOptions.inactivePaneOpacity]
E --> C
C --> F[Settings UI
shows default label at 0.9]
Reviews (1): Last reviewed commit: "fix(terminal): reduce inactive pane dimm..." | Re-trigger Greptile
Summary
Validation
pnpm run lintpnpm run typecheckpnpm run test(3,925 files; 41,470 tests passed)