Skip to content

Unify workspace appearance with terminal theme - #7251

Closed
tofunori wants to merge 2 commits into
stablyai:mainfrom
tofunori:codex/7246-unified-theme
Closed

tofunori wants to merge 2 commits into
stablyai:mainfrom
tofunori:codex/7246-unified-theme

Conversation

@tofunori

@tofunori tofunori commented Jul 3, 2026 •

Copy link
Copy Markdown

Summary

  • default Workspace Appearance to Match Terminal so the workspace chrome derives from the active terminal palette
  • apply the terminal palette to the full workspace shell while keeping App Default and Tinted Sidebar as opt-outs
  • keep blank browser tabs from painting the webview default white background behind Orca chrome
  • update Appearance settings copy/search and migration coverage for the new default

Tests

  • pnpm exec vitest run --config config/vitest.config.ts src/shared/constants.test.ts src/renderer/src/lib/left-sidebar-appearance.test.ts src/renderer/src/components/settings/AppearancePane.test.tsx src/main/persistence.test.ts
  • pnpm run verify:localization-catalog
  • pnpm run typecheck
  • bash "${CLAUDE_SKILL_DIR:-$HOME/.agents/skills/check}/scripts/run-tests.sh" (full suite: 23,769 passed, 1 existing/environment failure in src/main/repo-icon-autodetect.test.ts because this checkout resolves upstream as https://github.com/stablyai/orca.git instead of [email protected]:stablyai/orca.git)

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.

Copilot AI review requested due to automatic review settings July 3, 2026 15:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/main/persistence.ts
Comment on lines +2937 to +2941
const leftSidebarAppearanceDefaultedToMatchTerminal =
parsed.settings?.leftSidebarAppearanceDefaultedToMatchTerminal === true
const migratedLeftSidebarAppearanceMode = leftSidebarAppearanceDefaultedToMatchTerminal
? normalizeLeftSidebarAppearanceMode(parsed.settings?.leftSidebarAppearanceMode)
: 'match-terminal'
Comment thread src/shared/types.ts Resolved
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 408d51d6-484a-48d9-91fb-c042a54900c8

📥 Commits

Reviewing files that changed from the base of the PR and between a407e1a and c90b865.

📒 Files selected for processing (1)
  • src/shared/types.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/shared/types.ts

📝 Walkthrough

Walkthrough

This PR changes the default and migration behavior of leftSidebarAppearanceMode to match-terminal, adds a migration guard field, and updates persistence load/update handling. It adds resolveWorkspaceShellStyleVariables and wires it into App.tsx for workspace shell CSS variables. The settings UI, search metadata, and locale strings are renamed from “Left Sidebar Appearance” to “Workspace Appearance,” with a new “chrome” keyword. BrowserPane now hides the webview for blank tabs and adjusts the new-tab overlay background.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers summary and testing, but it omits the required Screenshots, AI Review Report, Security Audit, and Notes sections. Add the missing template sections, including screenshots or 'No visual change', AI review findings, security audit notes, and any platform-specific follow-up.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: making workspace appearance follow the terminal theme.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
src/main/persistence.ts (1)

2937-2941: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Missing "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 new leftSidebarAppearanceDefaultedToMatchTerminal migration 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 === true

As 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 win

Extract the shared "effective mode" fallback to avoid duplication.

settings.leftSidebarAppearanceMode ?? 'match-terminal' and the match-terminal branch (resolveTerminalSurfaceVariables(...)) are now duplicated between resolveLeftSidebarStyleVariables and resolveWorkspaceShellStyleVariables. 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

📥 Commits

Reviewing files that changed from the base of the PR and between 1403467 and a407e1a.

📒 Files selected for processing (17)
  • src/main/persistence.test.ts
  • src/main/persistence.ts
  • src/renderer/src/App.tsx
  • src/renderer/src/components/browser-pane/BrowserPane.tsx
  • src/renderer/src/components/settings/AppearancePane.test.tsx
  • src/renderer/src/components/settings/LeftSidebarAppearanceSetting.tsx
  • src/renderer/src/components/settings/appearance-sidebar-search.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/lib/left-sidebar-appearance.test.ts
  • src/renderer/src/lib/left-sidebar-appearance.ts
  • src/shared/constants.test.ts
  • src/shared/constants.ts
  • src/shared/types.ts

Comment thread src/main/persistence.ts
Comment on lines +2940 to +2941
? normalizeLeftSidebarAppearanceMode(parsed.settings?.leftSidebarAppearanceMode)
: 'match-terminal'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ 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.ts

Repository: 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 -B2

Repository: 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'.

Comment on lines 6978 to 6982
"leftSidebarAppearance": {
"title": "左サイドバーの外観",
"description": "左サイドバーを terminal に合わせるか、既定のままにするか、色合いを加えます。"
"description": "左サイドバーを terminal に合わせるか、既定のままにするか、色合いを加えます。",
"chrome": "chrome"
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 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' {}
done

Repository: 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

@nwparker

nwparker commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

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.

@nwparker nwparker closed this Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants