Simplify Appearance settings#6459
Conversation
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAppearance settings now use accordion-style sections with search-driven disclosure and shared search entries. The interface and window/sidebar settings were split into dedicated sections, and the top-level appearance pane now composes them with updated tests. Terminal settings add advanced typography controls and refactor terminal appearance sections for search-aware visibility, with related locale updates. PTY hidden-output restore adds a foreground timeout path, fallback cleanup, and new stalled-snapshot tests. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 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 |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (3)
src/renderer/src/components/settings/terminal-typography-search.ts (1)
107-109: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDocument the
slice(2)contract.This now depends on the first two catalog entries always being the primary typography controls; a later reorder would silently change which settings force-open under Advanced. As per coding guidelines, "
**/*.{ts,tsx,js,jsx}: When writing or modifying code driven by a design doc or non-obvious constraint, add a comment explaining why the code behaves the way it does."Suggested diff
export const getTerminalAdvancedTypographySearchEntries = createLocalizedCatalog(() => + // Why: font size and font family stay in the primary Terminal controls; + // only the remaining typography entries should force-open Advanced. getTerminalTypographySearchEntryCatalog().slice(2) )Source: Coding guidelines
src/renderer/src/components/settings/AppearanceShortcutHintList.tsx (1)
30-31: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winReplace the arbitrary
text-[10px]size with a design token.
text-[10px]bypasses the shared typography scale in a settings UI path that is supposed to stay on STYLEGUIDE/main.css tokens. Use the closest approved text size/token instead. As per coding guidelines, “Never invent new color values, font sizes, or shadow tiers when a documented one in STYLEGUIDE.md already covers the role” and “All UI work ... must followdocs/STYLEGUIDE.mdand use tokens defined insrc/renderer/src/assets/main.css.”Source: Coding guidelines
src/renderer/src/components/settings/AppearanceInterfaceSection.tsx (1)
63-68: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a short why-comment for the advanced-search gating.
showAdvancedis enforcing the PR’s “don’t expand empty/noisy advanced sections during search” behavior, but that constraint isn’t obvious from the predicate alone. Please document that intent here so this doesn’t get simplified away later.Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: e9f8ee3f-6300-4abf-954a-cad75eb35a0b
📒 Files selected for processing (25)
src/renderer/src/components/settings/AppearanceAdvancedDisclosure.tsxsrc/renderer/src/components/settings/AppearanceInterfaceSection.tsxsrc/renderer/src/components/settings/AppearancePane.test.tsxsrc/renderer/src/components/settings/AppearancePane.tsxsrc/renderer/src/components/settings/AppearanceSection.tsxsrc/renderer/src/components/settings/AppearanceShortcutHintList.tsxsrc/renderer/src/components/settings/AppearanceWindowSidebarSection.tsxsrc/renderer/src/components/settings/TerminalAdvancedTypographyControls.tsxsrc/renderer/src/components/settings/TerminalAppearanceSection.ghostty.test.tssrc/renderer/src/components/settings/TerminalAppearanceSection.tsxsrc/renderer/src/components/settings/TerminalCursorAppearanceSection.tsxsrc/renderer/src/components/settings/TerminalFontSizeSetting.tsxsrc/renderer/src/components/settings/TerminalPaneAppearanceSection.tsxsrc/renderer/src/components/settings/TerminalThemeSections.tsxsrc/renderer/src/components/settings/TerminalWindowSection.tsxsrc/renderer/src/components/settings/appearance-search.tssrc/renderer/src/components/settings/appearance-sidebar-search.tssrc/renderer/src/components/settings/terminal-search.test.tssrc/renderer/src/components/settings/terminal-search.tssrc/renderer/src/components/settings/terminal-typography-search.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.json
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/renderer/src/components/settings/AppearanceShortcutHintList.tsx (1)
22-31: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDocument why only the primary combo is rendered.
Line 22 intentionally ignores any secondary shortcut combos, which is a non-obvious UI constraint. Please add a short why-comment so this doesn’t get “fixed” later.
Suggested change
- const primaryCombo = combos[0] + // Why: Appearance rows stay compact by showing only the primary shortcut hint inline. + const primaryCombo = combos[0]As per coding guidelines, code driven by a non-obvious constraint should include a short why comment; the PR summary also calls out revised shortcut-hint behavior.
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 6ab5305d-5a68-4ef0-9e1f-a362ebb6b4e0
📒 Files selected for processing (2)
src/renderer/src/components/settings/AppearanceShortcutHintList.tsxsrc/renderer/src/components/settings/SettingsFormControls.tsx
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: bde52ca5-dbdc-4772-9e47-1d631180bcba
📒 Files selected for processing (4)
src/renderer/src/components/settings/SettingsFormControls.tsxsrc/renderer/src/components/settings/TerminalAppearanceSection.ghostty.test.tssrc/renderer/src/components/settings/TerminalAppearanceSection.tsxsrc/renderer/src/components/settings/TerminalThemeSections.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
- src/renderer/src/components/settings/TerminalAppearanceSection.ghostty.test.ts
- src/renderer/src/components/settings/TerminalAppearanceSection.tsx
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
…ce-config-improvement # Conflicts: # src/renderer/src/components/terminal-pane/pty-connection.test.ts # src/renderer/src/components/terminal-pane/pty-connection.ts
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/renderer/src/components/settings/AppearanceWindowSidebarSection.tsx (1)
61-75: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winExpand status-bar toggles for top-level status-bar matches.
SearchableSettingcan render the Status Bar row when the query matches its own title/keywords, butshowStatusBarControlsonly considers individual toggle matches. Searches like “status bar” can land on just the description instead of the controls.Suggested adjustment
+ const statusBarSectionMatches = matchesSettingsSearch(searchQuery, { + title: translate('auto.components.settings.AppearancePane.3e4175e5c6', 'Status Bar'), + keywords: ['status bar', 'indicators'] + }) const statusBarControlMatches = visibleStatusBarToggles.some((toggle) => matchesSettingsSearch(searchQuery, { title: toggle.title, description: toggle.description, keywords: toggle.keywords }) ) @@ - const showStatusBarControls = !isSearching || statusBarControlMatches + const showStatusBarControls = !isSearching || statusBarSectionMatches || statusBarControlMatches @@ - forceVisible={forceVisiblePrimary || statusBarControlMatches} + forceVisible={forceVisiblePrimary || statusBarSectionMatches || statusBarControlMatches}Also applies to: 91-105
🧹 Nitpick comments (1)
src/renderer/src/components/terminal-pane/pty-connection.test.ts (1)
6133-6473: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExtract the stalled-restore test harness.
These tests repeat the same transport, captured callback, snapshot mock, pane/deps setup, and disposal flow. A small helper would reduce drift and make timer cleanup expectations easier to keep consistent.
Refactor sketch
+async function createHiddenRestoreHarness(depsOptions?: Parameters<typeof createDeps>[0]) { + const { connectPanePty } = await import('./pty-connection') + const transport = createMockTransport('pty-id') + const capturedDataCallback = { + current: null as ((data: string, meta?: { seq?: number; rawLength?: number }) => void) | null + } + + transport.connect.mockImplementation(async ({ callbacks }: { callbacks: ConnectCallbacks }) => { + capturedDataCallback.current = callbacks.onData ?? null + return 'pty-id' + }) + transportFactoryQueue.push(transport) + + const pane = createPane(1) + const manager = createManager(1) + const deps = createDeps(depsOptions) + const disposable = connectPanePty(pane as never, manager as never, deps as never) + await flushAsyncTicks(6) + + return { + pane, + manager, + deps, + disposable, + getMainBufferSnapshot: window.api.pty.getMainBufferSnapshot as unknown as ReturnType<typeof vi.fn>, + emit: capturedDataCallback.current + } +}
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: ed46c02c-941a-49ca-aafb-846a111fb541
📒 Files selected for processing (17)
src/renderer/src/components/settings/AppearanceAdvancedDisclosure.tsxsrc/renderer/src/components/settings/AppearancePane.test.tsxsrc/renderer/src/components/settings/AppearanceWindowSidebarSection.tsxsrc/renderer/src/components/settings/SettingsFormControls.tsxsrc/renderer/src/components/settings/TerminalAppearanceSection.ghostty.test.tssrc/renderer/src/components/settings/TerminalAppearanceSection.tsxsrc/renderer/src/components/settings/TerminalCursorAppearanceSection.tsxsrc/renderer/src/components/settings/TerminalPaneAppearanceSection.tsxsrc/renderer/src/components/settings/TerminalThemeSections.tsxsrc/renderer/src/components/settings/TerminalWindowSection.tsxsrc/renderer/src/components/terminal-pane/pty-connection.test.tssrc/renderer/src/components/terminal-pane/pty-connection.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.json
🚧 Files skipped from review as they are similar to previous changes (12)
- src/renderer/src/components/settings/TerminalPaneAppearanceSection.tsx
- src/renderer/src/components/settings/AppearanceAdvancedDisclosure.tsx
- src/renderer/src/components/settings/TerminalCursorAppearanceSection.tsx
- src/renderer/src/components/settings/SettingsFormControls.tsx
- src/renderer/src/i18n/locales/zh.json
- src/renderer/src/components/settings/TerminalWindowSection.tsx
- src/renderer/src/i18n/locales/ja.json
- src/renderer/src/components/settings/AppearancePane.test.tsx
- src/renderer/src/i18n/locales/ko.json
- src/renderer/src/i18n/locales/es.json
- src/renderer/src/components/settings/TerminalAppearanceSection.tsx
- src/renderer/src/i18n/locales/en.json
Co-authored-by: Orca <help@stably.ai>
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
Review
Validation
Notes
Made with Orca 🐋