Repository navigation
Conversation
There was a problem hiding this comment.
Pull request overview
This PR makes “Match Terminal” the default for workspace appearance so the workspace chrome (shell + sidebar) derives its palette from the active terminal theme, while keeping “App Default” and “Tinted Sidebar” as explicit opt-outs. It also prevents blank browser tabs from flashing the webview’s default white background behind the app chrome, and updates settings copy/search plus migration coverage to support the new default.
Changes:
- Default workspace appearance to Match Terminal (new installs and migration guard for existing profiles).
- Apply terminal-derived palette variables to the full workspace shell when in match-terminal mode.
- Improve blank-tab rendering by hiding the webview layer and using themed background tokens.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/shared/types.ts | Adds a one-shot migration guard flag and updates settings documentation. |
| src/shared/constants.ts | Changes default appearance mode to match-terminal and stamps the guard for new profiles. |
| src/shared/constants.test.ts | Asserts the new default mode and guard in default settings. |
| src/renderer/src/lib/left-sidebar-appearance.ts | Defaults undefined mode to match-terminal and introduces workspace-shell variable resolution. |
| src/renderer/src/lib/left-sidebar-appearance.test.ts | Updates expectations for new defaults and adds coverage for shell theming helper. |
| src/renderer/src/i18n/locales/en.json | Updates settings copy/labels for “Workspace Appearance” and adds “chrome” search keyword. |
| src/renderer/src/i18n/locales/es.json | Adds “chrome” search keyword entry. |
| src/renderer/src/i18n/locales/ja.json | Adds “chrome” search keyword entry. |
| src/renderer/src/i18n/locales/ko.json | Adds “chrome” search keyword entry. |
| src/renderer/src/i18n/locales/zh.json | Adds “chrome” search keyword entry. |
| src/renderer/src/components/settings/LeftSidebarAppearanceSetting.tsx | Updates UI copy and defaults selection to match-terminal when unset. |
| src/renderer/src/components/settings/AppearancePane.test.tsx | Updates search/copy expectations and avoids defaulting to match-terminal in the “updates” test case. |
| src/renderer/src/components/settings/appearance-sidebar-search.ts | Updates search title/description and adds “chrome” keyword. |
| src/renderer/src/components/browser-pane/BrowserPane.tsx | Hides webview when blank to prevent white guest background bleed-through; uses themed background. |
| src/renderer/src/App.tsx | Applies workspace-shell CSS variables (terminal-derived) at the app root when match-terminal is active. |
| src/main/persistence.ts | Adds migration/normalization for appearance mode and stamps the migration guard on updates. |
| src/main/persistence.test.ts | Adds tests for one-shot migration behavior and guard stamping. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const leftSidebarAppearanceDefaultedToMatchTerminal = | ||
| parsed.settings?.leftSidebarAppearanceDefaultedToMatchTerminal === true | ||
| const migratedLeftSidebarAppearanceMode = leftSidebarAppearanceDefaultedToMatchTerminal | ||
| ? normalizeLeftSidebarAppearanceMode(parsed.settings?.leftSidebarAppearanceMode) | ||
| : 'match-terminal' |
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
|
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 (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR changes the default and migration behavior of 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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.
Actionable comments posted: 2
🧹 Nitpick comments (2)
src/main/persistence.ts (1)
2937-2941: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMissing "Why" comment on new migration logic.
Every sibling one-shot migration in this function (
autoRenameBranchFromWork,terminalCursorStyle,floatingTerminalDefaultedForAllUsers,experimentalActivity, etc.) carries a// Why:comment explaining the guard rationale. This newleftSidebarAppearanceDefaultedToMatchTerminalmigration lacks one, which breaks the established self-documenting pattern for non-obvious "flip old profiles once, then respect later explicit choices" logic.📝 Proposed fix
+ // Why: new profiles default to the terminal-matched sidebar. Existing + // profiles are flipped to 'match-terminal' once; a later explicit + // Default/Tinted choice then survives future reloads via the guard. const leftSidebarAppearanceDefaultedToMatchTerminal = parsed.settings?.leftSidebarAppearanceDefaultedToMatchTerminal === trueAs per path instructions: "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. Keep comments short — one or two lines, capturing only the non-obvious reason."
Source: Path instructions
src/renderer/src/lib/left-sidebar-appearance.ts (1)
116-141: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExtract the shared "effective mode" fallback to avoid duplication.
settings.leftSidebarAppearanceMode ?? 'match-terminal'and the match-terminal branch (resolveTerminalSurfaceVariables(...)) are now duplicated betweenresolveLeftSidebarStyleVariablesandresolveWorkspaceShellStyleVariables. A shared helper would keep the fallback default in one place.♻️ Proposed refactor to share the effective-mode resolution
+function resolveEffectiveLeftSidebarAppearanceMode( + mode: LeftSidebarAppearanceSettings['leftSidebarAppearanceMode'] | undefined +) { + return mode ?? 'match-terminal' +} + export function resolveLeftSidebarStyleVariables( settings: LeftSidebarAppearanceSettings | null | undefined, systemPrefersDark: boolean ): LeftSidebarStyleVariables | undefined { if (!settings) { return undefined } - switch (settings.leftSidebarAppearanceMode ?? 'match-terminal') { + switch (resolveEffectiveLeftSidebarAppearanceMode(settings.leftSidebarAppearanceMode)) { case 'default': return undefined case 'match-terminal': return resolveTerminalSurfaceVariables(settings, systemPrefersDark) case 'tinted': return resolveTintedSurfaceVariables(settings) } } export function resolveWorkspaceShellStyleVariables( settings: LeftSidebarAppearanceSettings | null | undefined, systemPrefersDark: boolean ): LeftSidebarStyleVariables | undefined { - if (!settings || (settings.leftSidebarAppearanceMode ?? 'match-terminal') !== 'match-terminal') { + if ( + !settings || + resolveEffectiveLeftSidebarAppearanceMode(settings.leftSidebarAppearanceMode) !== 'match-terminal' + ) { return undefined } return resolveTerminalSurfaceVariables(settings, systemPrefersDark) }
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 3d87aebb-4f45-49f6-b104-68f1350706b3
📒 Files selected for processing (17)
src/main/persistence.test.tssrc/main/persistence.tssrc/renderer/src/App.tsxsrc/renderer/src/components/browser-pane/BrowserPane.tsxsrc/renderer/src/components/settings/AppearancePane.test.tsxsrc/renderer/src/components/settings/LeftSidebarAppearanceSetting.tsxsrc/renderer/src/components/settings/appearance-sidebar-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.jsonsrc/renderer/src/lib/left-sidebar-appearance.test.tssrc/renderer/src/lib/left-sidebar-appearance.tssrc/shared/constants.test.tssrc/shared/constants.tssrc/shared/types.ts
| ? normalizeLeftSidebarAppearanceMode(parsed.settings?.leftSidebarAppearanceMode) | ||
| : 'match-terminal' |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Inspect the normalizer's fallback and confirm it's intentional post-migration.
ast-grep run --pattern 'function normalizeLeftSidebarAppearanceMode($$$) { $$$ }' --lang typescript src/shared/left-sidebar-appearance.ts
rg -n "normalizeLeftSidebarAppearanceMode" -A3 -B3 src/shared/left-sidebar-appearance.tsRepository: stablyai/orca
Length of output: 513
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== left-sidebar-appearance.ts =="
cat -n src/shared/left-sidebar-appearance.ts | sed -n '1,120p'
echo
echo "== persistence.ts around load/updateSettings call sites =="
cat -n src/main/persistence.ts | sed -n '2900,2965p'
echo
cat -n src/main/persistence.ts | sed -n '5060,5105p'Repository: stablyai/orca
Length of output: 8151
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== search for leftSidebarAppearanceDefaultedToMatchTerminal and leftSidebarAppearanceMode defaults =="
rg -n "leftSidebarAppearance(DefaultedToMatchTerminal|Mode)" src -A3 -B3
echo
echo "== settings defaults / schema references =="
rg -n "match-terminal|leftSidebarAppearanceMode" src/shared src/main src/renderer -A2 -B2Repository: stablyai/orca
Length of output: 36209
Align the sidebar sanitizer with the new default. normalizeLeftSidebarAppearanceMode() still falls back to 'default', so a corrupted or user-edited leftSidebarAppearanceMode will be loaded/saved as the old app-default surface even after the migration guard is set. That leaves invalid persisted input on the wrong mode instead of 'match-terminal'.
| "leftSidebarAppearance": { | ||
| "title": "左サイドバーの外観", | ||
| "description": "左サイドバーを terminal に合わせるか、既定のままにするか、色合いを加えます。" | ||
| "description": "左サイドバーを terminal に合わせるか、既定のままにするか、色合いを加えます。", | ||
| "chrome": "chrome" | ||
| }, |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Confirm whether AppearancePane.leftSidebarAppearance strings were updated
# to match the "Workspace Appearance"/"App Default" rename across locales.
for f in en es ja ko zh; do
echo "== $f =="
fd "$f.json" src/renderer/src/i18n/locales --exec jq '.auto.components.settings.AppearancePane.leftSidebarAppearance' {}
doneRepository: stablyai/orca
Length of output: 2185
Localization catalogs for AppearancePane were not updated to match the English rename.
The English UI text was renamed to "Workspace Appearance" / "App Default", but the non-English locale catalogs still show stale terminology:
- ja: "左サイドバーの外観" / "デフォルト" (Left Sidebar Appearance / Default)
- es: "Apariencia de la barra lateral izquierda" / "Predeterminado"
- ko: "왼쪽 사이드바 모양" / "기본값"
- zh: "左侧边栏外观" / "默认"
The search-index "chrome" keyword addition at lines 6978–6982 does not address this parity gap. Update components.settings.AppearancePane.leftSidebarAppearance.title and .default in all non-English locales to match the English rename before merge.
Source: Learnings
|
Closing as superseded by #36567: Match Terminal is now a full app theme that colors the whole window and keeps low-contrast terminal palettes legible. Thank you for this PR, it shaped the design. |
Summary
Tests
Local visual validation was done with ORCA_DEV_USER_DATA_PATH=/tmp/orca-7246-local-test pnpm run dev.
ELI5
Workspace chrome can match the active terminal theme by default. App Default and Tinted Sidebar remain options; blank browser tabs no longer flash white.