Skip to content

feat(appearance): app chrome can match terminal theme; configurable status-bar usage format - #16768

Closed
seedotlee wants to merge 7 commits into
stablyai:mainfrom
seedotlee:feat/workspace-chrome-match-terminal
Closed

seedotlee wants to merge 7 commits into
stablyai:mainfrom
seedotlee:feat/workspace-chrome-match-terminal

Conversation

@seedotlee

@seedotlee seedotlee commented Aug 27, 2026 •

Copy link
Copy Markdown

ELI5

Two appearance settings: (1) the whole app frame (tab strip, status bar, side panels, popovers) can adopt the terminal theme's colors instead of the app theme, and (2) the status bar's usage text can be formatted with a user-defined template.

What Changed

feat(appearance): let file editors follow the terminal theme in match-terminal mode (closes #17199)

  • Monaco surfaces (file editor, plain text, diffs, combined diffs, notebooks, markdown source, code excerpts) were hard-wired to vs / vs-dark, and the Markdown preview / rich editor painted the fixed --editor-surface with GitHub-colored hljs tokens — so in match-terminal mode the editor pane was the one surface still on the app theme.
  • terminal-editor-palette.ts derives an editor palette from the active terminal theme (background / foreground / cursor / selection + syntax roles mapped onto the ANSI slots) and builds a Monaco theme (orca-terminal) from it; light/dark is rated by the terminal background's luminance, so a light terminal theme under a dark OS setting still gets light styling.
  • Match-terminal chrome variables now also carry --editor-surface and a --syntax-* set that the hljs stylesheets read ahead of their defaults (non-match-terminal look unchanged).
  • useEditorSurfaceAppearance / useMonacoEditorTheme replace the per-component isDark ? 'vs-dark' : 'vs'; the diff-section chain passes the Monaco theme name instead of a dark flag.

feat(appearance): let app chrome follow the terminal theme

  • New Settings → Appearance → "App Chrome Appearance" (Default / Match Terminal), next to Left Sidebar Appearance.
  • In match-terminal mode the terminal theme's background/foreground are written as document-root CSS variables (--bg-titlebar, --background / --card / --popover / …, both sidebar token families), so the tab strip, status bar, side panels, full-page views and popovers follow the terminal. Left-sidebar modes still win because they scope their own variables below the root.
  • Terminal color pair + token derivation moved into terminal-surface-colors.ts and shared with the sidebar resolver.
  • Persisted as workspaceChromeAppearance in global settings.

feat(status-bar): configurable usage format template

  • New Settings → Appearance → Status Bar → "Usage format": a template that replaces the built-in per-provider usage text when non-empty.
  • Placeholders: {provider}, {plan}, the 5h / 7d / fable / 30d windows as percentages (following Used/Remaining), {x.reset} countdowns, {x.resetAt} clock times, Gemini {buckets}. [...] groups drop out when a placeholder inside is empty so one template works across providers with different windows. Whitespace is rendered as authored.
  • Persisted as PersistedUIState.statusBarUsageFormat (with a byProvider override map reserved for later); the RPC UI-update schema gains the optional field.

Why

Users who pick a terminal theme often want the surrounding chrome to match instead of clashing with the app theme, and the built-in usage text is fixed per provider — a template lets people show exactly the windows/format they care about in the limited status-bar space. Both are opt-in and default to existing behavior.

Linked Issue

Fixes #16936 (app chrome should be able to match the terminal theme)
Fixes #16937 (configurable status bar usage format)

Visual Proof

Terminal theme in these shots: Everforest Light (Settings → Appearance → Terminal Themes):

terminal theme: Everforest Light

New settings — App Chrome Appearance = Match Terminal and Usage format with live preview:

App Chrome Appearance + Usage format settings

After — with Match Terminal on, the sidebar, tab strip, panes and status bar all take the Everforest Light surface colors; the status bar shows the custom {provider}[ | 5h: {5h} ( resets {5h.reset} ) ][ | 7d: {7d}] template:

After: app chrome matches terminal theme

Before — with App Chrome Appearance = Default (the current behavior), the same window renders with the stock app-theme chrome; both settings default to the existing behavior, so this PR changes nothing unless opted in.

Testing

  • Unit tests added: workspace-chrome-appearance.test.ts, usage-format-template.test.ts, provider-segment-usage-format.test.tsx, StatusBarUsageFormatSetting.test.tsx, status-bar-usage-format.test.ts; existing appearance/search tests updated.

  • Rebased onto current main (conflicts in constants.ts / en.json resolved; the appearance default now lives in default-global-settings.ts); pnpm tc, affected test files (126 tests), oxlint and oxfmt --check on changed files all pass locally.

  • Manually tested on macOS (local workspaces). Settings are renderer-only presentation state; no execution-host / SSH behavior is touched.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

AI Disclosure

Implemented with Claude (Claude Code, Claude Fable 5); reviewed and tested by the author.

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a36a136e-1c4a-44ec-b788-6264e3981b29

📥 Commits

Reviewing files that changed from the base of the PR and between d9bbc8a1c8e97b64b328d32050df0a1f85ac2bbc and c4d86e9d00c954dbf3010fbfb74dc68c81f871f2.

📒 Files selected for processing (2)
  • src/renderer/src/components/status-bar/StatusBar.tsx
  • src/renderer/src/components/status-bar/provider-segment-usage-format.test.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The PR adds persisted status-bar usage templates with provider-specific overrides, normalization, previews, and dynamic rendering. It adds workspace chrome appearance settings that can apply terminal-derived colors to document-level UI surfaces. Shared color helpers now serve workspace chrome, left-sidebar styling, and editor themes. Editor and diff components use centralized surface and Monaco theme resolution. Search catalogs, localization strings, defaults, hydration, RPC validation, and tests support these changes.

Merge Risk: ⚪ Minimal · up to c4d86

The PR adds opt-in terminal-matched appearance and configurable status-bar formatting while preserving existing defaults; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.13% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 62 functions across 47 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes both primary changes: app chrome matching the terminal theme and configurable status-bar usage formatting.
Description check ✅ Passed The description includes all required sections, explains the changes and rationale, links the relevant issues, provides visual proof, documents testing, and completes the checklist.
Linked Issues check ✅ Passed The implementation addresses all linked coding objectives: app chrome theming in #16936, configurable usage templates in #16937, and terminal-matched editor surfaces in #17199.
Out of Scope Changes check ✅ Passed The changes remain focused on the linked appearance and status-bar objectives. Shared color utilities, editor integrations, localization, search entries, persistence, and tests directly support those …
Full details: Out of Scope Changes check

Explanation

The changes remain focused on the linked appearance and status-bar objectives. Shared color utilities, editor integrations, localization, search entries, persistence, and tests directly support those objectives.


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


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e94d8197-88c9-4724-8599-1386ae6d729f

📥 Commits

Reviewing files that changed from the base of the PR and between 026389a and 975f2cd.

📒 Files selected for processing (28)
  • src/main/runtime/rpc/methods/client-ui-schemas.ts
  • src/renderer/src/app-shell/use-app-chrome-layout.ts
  • src/renderer/src/components/settings/AppearancePane.test.tsx
  • src/renderer/src/components/settings/AppearanceWindowSidebarSection.tsx
  • src/renderer/src/components/settings/StatusBarUsageFormatSetting.test.tsx
  • src/renderer/src/components/settings/StatusBarUsageFormatSetting.tsx
  • src/renderer/src/components/settings/WorkspaceChromeAppearanceSetting.tsx
  • src/renderer/src/components/settings/appearance-search.ts
  • src/renderer/src/components/settings/appearance-sidebar-search.ts
  • src/renderer/src/components/settings/appearance-status-bar-usage-format-search.ts
  • src/renderer/src/components/settings/terminal-search.test.ts
  • src/renderer/src/components/status-bar/StatusBar.tsx
  • src/renderer/src/components/status-bar/provider-segment-usage-format.test.tsx
  • src/renderer/src/components/status-bar/usage-format-template.test.ts
  • src/renderer/src/components/status-bar/usage-format-template.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/left-sidebar-appearance.ts
  • src/renderer/src/lib/terminal-surface-colors.ts
  • src/renderer/src/lib/use-workspace-chrome-document-style.ts
  • src/renderer/src/lib/workspace-chrome-appearance.test.ts
  • src/renderer/src/lib/workspace-chrome-appearance.ts
  • src/renderer/src/store/slices/ui.ts
  • src/shared/constants.ts
  • src/shared/global-settings-types.ts
  • src/shared/persisted-ui-state-types.ts
  • src/shared/status-bar-usage-format.test.ts
  • src/shared/status-bar-usage-format.ts
  • src/shared/ui-chrome-types.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Comment thread src/renderer/src/i18n/locales/en.json Resolved
@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@greptile-apps

greptile-apps Bot commented Aug 29, 2026 •

Copy link
Copy Markdown

Greptile Summary

The PR adds terminal-matched application chrome and editor themes, plus configurable status-bar usage templates.

  • Derives application chrome, editor surfaces, syntax colors, and Monaco themes from the active terminal theme.
  • Adds persisted appearance controls for matching application chrome to the terminal.
  • Adds global and provider-aware usage-format templates with optional placeholder groups.
  • Updates compact usage rendering so a configured template replaces the built-in compact label.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/renderer/src/components/status-bar/StatusBar.tsx Routes configured usage templates through the verbose renderer in both usage modes; the previously reported compact-mode bypass is fixed.
src/renderer/src/components/status-bar/usage-format-template.ts Builds provider usage placeholder values and renders optional template groups as text.
src/renderer/src/lib/terminal-editor-palette.ts Derives editor surface and syntax colors from terminal themes and produces Monaco theme data.
src/renderer/src/lib/use-workspace-chrome-document-style.ts Applies terminal-derived document-level chrome variables when match-terminal appearance is enabled.
src/renderer/src/components/editor/use-monaco-editor-theme.ts Resolves and reapplies the appropriate built-in or terminal-derived Monaco theme.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Settings[Appearance settings] --> ChromeMode[App chrome appearance]
  TerminalTheme[Active terminal theme] --> Palette[Derived surface and syntax palette]
  ChromeMode --> Palette
  Palette --> CSS[Document chrome variables]
  Palette --> Monaco[Monaco terminal theme]
  Format[Usage format template] --> Resolver[Global/provider template resolver]
  Usage[Provider usage data] --> Values[Placeholder values]
  Resolver --> Renderer[Template renderer]
  Values --> Renderer
  Renderer --> StatusBar[Status-bar provider segment]
Loading

Reviews (6): Last reviewed commit: "fix(editor): keep Monaco theme registrat..." | Re-trigger Greptile

@seedotlee

Copy link
Copy Markdown
Author

Re Greptile's "Compact mode bypasses templates" (StatusBar.tsx ProviderSegment): fixed in c4d86e9. A non-empty usage template now replaces the built-in text in both usage modes — compact mode previously fell back to the tightest-window WindowLabel and ignored the template. The mini bar stays verbose-only. Test added in provider-segment-usage-format.test.tsx covering mode="compact".

@seedotlee
seedotlee force-pushed the feat/workspace-chrome-match-terminal branch from f6571e8 to dec5d39 Compare August 30, 2026 14:55
lisi and others added 7 commits August 31, 2026 11:25
Add an "App Chrome Appearance" setting (Default / Match Terminal) next to
Left Sidebar Appearance. In match-terminal mode the terminal theme's
background/foreground are written as document-root CSS variables
(--bg-titlebar, --background/--card/--popover/..., both sidebar token
families), so the tab strip, status bar, side panels, full-page views and
popovers all follow the terminal instead of the app theme. Left-sidebar
modes still win because they scope their own variables below the root.

The terminal color pair and token derivation move into
terminal-surface-colors.ts and are shared with the sidebar resolver.

Co-Authored-By: Claude Fable 5 <[email protected]>
Add Settings → Appearance → Status Bar → "Usage format": a template that
replaces the built-in per-provider usage text when non-empty. Placeholders
cover {provider}, {plan}, the 5h/7d/fable/30d windows as percentages
(following Used/Remaining), {x.reset} countdowns, {x.resetAt} clock times
and Gemini {buckets}; "[...]" groups drop out when a placeholder inside is
empty so one template works across providers with different windows.
Whitespace is rendered as authored (whitespace-pre).

Persisted as PersistedUIState.statusBarUsageFormat with a byProvider
override map reserved for later; the RPC UI-update schema gains the
optional field.

Co-Authored-By: Claude Fable 5 <[email protected]>
…n search

Add one-line JSDoc to every function this branch adds or edits so the
review docstring gate passes. Include the usage-format entry in the
Status Bar section's search match so searching "template" or
"placeholder" no longer hides the parent row, and mention popovers in
the App Chrome Appearance descriptions since the setting styles them.

Co-Authored-By: Claude Fable 5 <[email protected]>
…-terminal mode

With App Chrome Appearance = Match Terminal, the tab strip, status bar and
side panels took the terminal palette but every file pane kept the stock app
theme: Monaco (code, plain text, diffs, notebooks, markdown source) was
hard-wired to `vs`/`vs-dark`, and the markdown preview / rich editor painted
the fixed `--editor-surface` with GitHub-colored hljs tokens.

- `terminal-editor-palette.ts` derives an editor palette from the active
  terminal theme (background/foreground/cursor/selection + syntax roles mapped
  onto the ANSI slots) and builds a Monaco theme (`orca-terminal`) from it;
  light/dark is rated by the terminal background, so a light terminal theme
  under a dark OS setting still gets light styling.
- match-terminal chrome variables now include `--editor-surface` and
  `--syntax-*`; the hljs stylesheets read those ahead of their defaults.
- `useEditorSurfaceAppearance` / `useMonacoEditorTheme` replace the inline
  `isDark ? 'vs-dark' : 'vs'` computations; the diff-section chain passes the
  Monaco theme name instead of a dark flag.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VbWbChctXeMvaR2zdbFY99
(cherry picked from commit dc85fad)
ProviderSegment only rendered a user template on the verbose branch, so
switching usage mode to compact silently fell back to the built-in
tightest-window label. A non-empty template now replaces the built-in
text in both modes; the mini bar stays verbose-only.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VbWbChctXeMvaR2zdbFY99
Adds one-line JSDoc to the editor surfaces, diff viewers, palette helpers
and UI-slice entry points this branch modifies so the diff's docstring
coverage clears the pre-merge threshold.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VbWbChctXeMvaR2zdbFY99
…render

The upgraded oxlint React rules flag reassigning a module variable during
render and calling Date.now() inside useMemo. Move the terminal Monaco
theme's signature cache into ensureTerminalMonacoTheme() and pin the
usage-format preview clock with a lazy useState initializer.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VbWbChctXeMvaR2zdbFY99
@seedotlee
seedotlee force-pushed the feat/workspace-chrome-match-terminal branch from d0a5c2f to 80c1c1a Compare August 31, 2026 03:27
@seedotlee

Copy link
Copy Markdown
Author

@brennanb2025 Hi! Just checking in on this PR — is it something you'd be willing to merge? It keeps drifting into merge conflicts with main, so I'd rather not keep rebasing blindly. If it's a yes, please @ me (@seedotlee) and I'll resolve the conflicts right away. If it's not a fit, no worries, just let me know and I'll close it. Thanks!

@bitconym

Copy link
Copy Markdown

+1 from a daily user. I'd love to run Orca with Rosé Pine Moon throughout. Right now "Match terminal" only recolours the left sidebar, and the rest of the default dark chrome is too dark for me. This PR (the app chrome and editors following the terminal theme) is exactly what I'm after. @brennanb2025, could you let the author know whether this direction will be merged, so the conflicts can be resolved?

@y1k333

y1k333 commented Sep 27, 2026

Copy link
Copy Markdown

any update on this?

@sergeysulimko

Copy link
Copy Markdown

+1, daily user on macOS (two Macs plus a remote Orca server). This PR is the piece we are missing.

Concrete case: I am protanopic, so I need a terminal theme where red and green stay apart (GitHub Dark Colorblind, Tokyo Night). Those themes have a tinted background, and with the current chrome only the left sidebar follows it ("Match Terminal") while the tab bar, status bar and right sidebar stay stock dark. The window ends up in two color systems, so in practice I'm limited to plain black or neutral grey terminal themes.

Is anything blocking review here? Happy to test a build.

jsandai added a commit to jsandai/orca that referenced this pull request Oct 10, 2026
…terminal theme

Adds Settings > Appearance > "Title & Status Bar Appearance" (Default / Match
Terminal). In match-terminal mode the terminal's background and foreground are
scoped onto the title bar, tab strip, status bar, and window controls through
the existing --bg-titlebar hook plus the surface/text tokens the left sidebar's
match-terminal mode already derives, so tabs and text stay readable on light
terminal themes. Nothing outside those bars changes, and the default keeps the
current look.

Persisted as workspaceChromeAppearanceMode, the same key as stablyai#16768, so that PR
can widen the scope later without a migration. The left sidebar appearance
fields move into ChromeAppearanceSettings because global-settings-types.ts is
at its max-lines cap.

Refs stablyai#10864, stablyai#16936
jsandai added a commit to jsandai/orca that referenced this pull request Oct 10, 2026
- Monaco (file editor, diffs, combined diffs, PR diffs, notebooks, code
  excerpts, automation prompt) gets an "orca-terminal" theme built from the
  terminal's background, foreground, cursor, selection, and ANSI colors.
- Markdown preview, rich editor, and notebook panes paint --editor-surface and
  read --syntax-* hooks, falling back to their existing GitHub colors.

Credit: the terminal editor palette and Monaco theme generation
(terminal-editor-palette.ts and its tests, monaco-terminal-theme-registry.ts,
use-monaco-editor-theme.ts), the --syntax-* hooks in markdown-preview.css and
rich-markdown-editor.css, and the isDark -> monacoTheme prop change in the diff
components are taken from stablyai#16768 by @seedotlee.

Adapted to current main: stablyai#16768 predates useDocumentDarkTheme, so instead of a
separate surface-appearance hook, useDocumentDarkTheme now honors the
match-terminal light/dark decision, which also brings mermaid and markdown
along. Light/dark is rated on the opaque background so editors and chrome
always agree.
jsandai added a commit to jsandai/orca that referenced this pull request Oct 10, 2026
…he terminal

Without these, match-terminal surfaces kept the app theme's greys for
--secondary, --input, and --ring. Mix ratios match stablyai#16768.
@AmethystLiang

Copy link
Copy Markdown
Contributor

Thank you @seedotlee for the appearance and status-bar work. We combined the remaining status-bar usage template into the draft replacement, #40456, preserved your original commits, and credited you in its description; current main already implements the related Match Terminal app and editor themes, so we kept that newer implementation. I will close this PR in favor of the combined draft, which still needs current-main conflicts resolved and its broad test failures investigated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

5 participants