Repository navigation
Conversation
…ine height, theme) (stablyai#20392)
📝 WalkthroughWalkthroughAdds Chat Appearance settings for theme, font family, font size, line height, and monospace font. The settings receive defaults and normalization before persistence. A new Appearance section provides controls, search entries, summaries, and deep-link support. Native chat views apply computed CSS variables for typography and optional terminal surface colors. Tests cover the controls, normalization-related styling, and appearance section behavior. Documentation describes the new settings. Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: 🔵 Low · up to Users may be unable to type a replacement font size normally, and screen-reader users cannot identify the font-size controls. These are bounded settings usability issues. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the purpose, implementation, settings, linked issue, and automated tests. It omits several required template sections, including visual proof for this UI change, manual testing details and platform coverage, review notes, the checklist, and other applicable declarations. Resolution Complete the required description sections. Attach before-and-after visual proof, or provide the required N/A explanation only if there is no visual or interaction change. Add manual test status, tested platforms, applicable AI disclosure, review notes, cross-platform and compatibility considerations, and checklist results. Full details: Docstring CoverageExplanation Docstring coverage is 13.64% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 22 functions across 19 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 1⚔️ Resolve merge conflicts 💡
Warning 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
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 1f944c59-2a2f-40d0-9a1f-375cd3ed3661
📒 Files selected for processing (21)
docs/site/content/docs/agents/native-chat.mdxsrc/main/persistence/applying-settings/settings-update.tssrc/renderer/src/assets/main.csssrc/renderer/src/components/native-chat/NativeChatResolvedView.tsxsrc/renderer/src/components/native-chat/NativeChatStructuredSession.tsxsrc/renderer/src/components/native-chat/NativeChatView.tsxsrc/renderer/src/components/native-chat/use-native-chat-appearance-style.test.tssrc/renderer/src/components/native-chat/use-native-chat-appearance-style.tssrc/renderer/src/components/settings/AppearancePane.test.tsxsrc/renderer/src/components/settings/AppearancePane.tsxsrc/renderer/src/components/settings/ChatAppearanceSection.test.tsxsrc/renderer/src/components/settings/ChatAppearanceSection.tsxsrc/renderer/src/components/settings/appearance-chat-search.tssrc/renderer/src/components/settings/appearance-search.tssrc/renderer/src/lib/left-sidebar-appearance.tssrc/renderer/src/store/slices/settings.tssrc/renderer/src/store/slices/ui/ui-slice-contract-contextual.tssrc/shared/chat-appearance-settings.tssrc/shared/default-global-settings.tssrc/shared/global-settings-types.tssrc/shared/ui-chrome-types.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.
| )} | ||
| control={ | ||
| <div className="flex items-center gap-2"> | ||
| <Button |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
sed -n '115,190p' src/renderer/src/components/settings/ChatAppearanceSection.tsx
sed -n '45,85p' src/renderer/src/components/settings/SettingsFormControls.tsx
rg -n 'function Button|const Button|aria-label|aria-labelledby' src/renderer/src/components/ui src/renderer/src/components/settings/SettingsFormControls.tsxRepository: stablyai/orca
Length of output: 5871
🏁 Script executed:
sed -n '1,75p' src/renderer/src/components/settings/ChatAppearanceSection.tsx
sed -n '1,130p' src/renderer/src/components/ui/button.tsx
fd -i 'input.tsx' src/renderer/src/components
fd -i 'label.tsx' src/renderer/src/componentsRepository: stablyai/orca
Length of output: 5743
🏁 Script executed:
sed -n '1,100p' src/renderer/src/components/ui/input.tsx
sed -n '1,100p' src/renderer/src/components/ui/label.tsx
sed -n '1,180p' src/renderer/src/components/settings/SearchableSetting.tsxRepository: stablyai/orca
Length of output: 2672
Add accessible names to the font-size controls.
SettingsRow renders a sibling Label, and SearchableSetting does not render another label. The numeric Input therefore has no accessible name. The decrease and increase Button elements contain only icons, so screen readers cannot identify their actions. Add localized aria-label values such as “Decrease font size”, “Font size”, and “Increase font size”, or explicitly associate the input with the label.
| onChange={(e) => { | ||
| const value = Number.parseInt(e.target.value, 10) | ||
| if ( | ||
| !Number.isNaN(value) && | ||
| value >= MIN_CHAT_FONT_SIZE && | ||
| value <= MAX_CHAT_FONT_SIZE | ||
| ) { | ||
| updateSettings({ chatFontSize: value }) | ||
| } | ||
| }} |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Keep a draft value until font-size commit.
The controlled input rejects invalid intermediate values on every keystroke. For example, replacing 13 with 20 first produces 2, which is rejected and restores 13.
Keep local draft state. Clamp and persist on blur or Enter.
There was a problem hiding this comment.
Important
Two blocking localization CI gates fail on this branch. verify:localization-catalog and verify:localization-extraction both report every new auto.components.settings.ChatAppearanceSection.* / AppearancePane.chat* key as missing from src/renderer/src/i18n/locales/en.json, which this PR does not touch. Runtime is unaffected (i18n falls back to the inline English defaults), but the required checks cannot go green until the catalog is regenerated.
Reviewed changes
- New settings fields —
chatAppearanceMode,chatFontFamily,chatFontSize,chatLineHeight,chatFontMonoonGlobalSettings, with defaults and sharednormalizeChat*/applyChatSettingsNormalizationsapplied at both the main and renderer settings boundaries. - CSS variable surface —
.native-chat-surfaceinmain.csspublishes--chat-font-size/--chat-line-height/--chat-font-familyand proportionally remaps.text-sm,.text-xs,.text-[11px],.text-[10px], and.leading-relaxed. useNativeChatAppearanceStyle— memoized inline CSS vars, terminal-font fallback for mono, and reuse of the now-exportedresolveTerminalSurfaceVariablesformatch-terminal.- Settings UI — new
ChatAppearanceSectionunderSettings → Appearance → Chat, wired intoAppearancePane(newchatsection key + summary), the deep-link union, and the settings search catalog. - Docs —
native-chat.mdxgains an## Appearancesection.
⚠️ New localization keys are missing from en.json, failing two required gates
Every new translate(...) call in AppearancePane.tsx, ChatAppearanceSection.tsx, and appearance-chat-search.ts introduces a key that is not in src/renderer/src/i18n/locales/en.json, and this PR does not update that file. The verifier treats a missing key as an error, so both the catalog and extraction gates exit 1; they are blocking steps in .github/workflows/pr.yml and in the root pnpm lint chain.
Technical details
# New translate() keys absent from en.json
## Affected sites
- `src/renderer/src/components/settings/AppearancePane.tsx:127,217,221,222` — `AppearancePane.chatTitle`, `.chatDefaultFont`, `.chatMatchTerminalMode`, `.chatDefaultMode`
- `src/renderer/src/components/settings/ChatAppearanceSection.tsx:48-238` — 11 `ChatAppearanceSection.*` keys
- `src/renderer/src/components/settings/appearance-chat-search.ts:9-146` — 20+ `ChatAppearanceSection.*` keys
- `src/renderer/src/i18n/locales/en.json` — unchanged by this PR, so `flattenCatalogKeys(en)` has none of the above
## Evidence (this branch, vs merge-base `f2d5711`)
- `node config/scripts/verify-localization-catalog.mjs` → exit 1: "Localization keys are missing from src/renderer/src/i18n/locales/en.json."
- `node config/scripts/verify-localization-extraction.mjs` → exit 1: "Extracted keys missing from en.json: auto.components.settings.ChatAppearanceSection…"
- `verify:localization-runtime-catalog` and `verify:localization-coverage` pass, and `check:code-quality:changed` passes.
## Required outcome
- `en.json` contains every new key with its English fallback so both gates pass.
## Suggested approach
- `pnpm run sync:localization-catalog` bootstraps the entries from the inline fallbacks, then re-run `pnpm run verify:localization-extraction`.
- `fontFamilyTitle`, `fontSizeTitle`, `lineHeightTitle`, and `fontMonoTitle` are used with different fallback text in `ChatAppearanceSection.tsx` and `appearance-chat-search.ts`; the bootstrap keeps only the first-seen value, so align the fallbacks or give the search-catalog entries their own keys.
</details>
### ℹ️ Nitpicks
- `default-global-settings.ts:50-54` and `AppearancePane.tsx:218` hardcode `13` / `1.4` / `'default'` instead of the `DEFAULT_CHAT_*` constants this PR just added, inviting drift.
- The PR description lists the ranges as 9–32 px and 1.0–2.5, but the code and docs both ship 10–24 px and 1.0–3.0.
- `useNativeChatAppearanceStyle` is called and `.native-chat-surface` + `style` applied in `NativeChatView`, `NativeChatResolvedView`, and `NativeChatStructuredSession`; the inner applications are redundant in the production tree (they only matter for direct renders/tests).
- `appearanceAccordionDeepLink` now accepts `'chat'`, but nothing sets it, and the deep-link effect always scrolls to `USAGE_PERCENTAGE_DISPLAY_SETTING_ID`, so a `'chat'` link would reveal the section at the wrong scroll target.
- The new `normalizeChat*` / `applyChatSettingsNormalizations` logic has no unit tests, unlike the sibling normalizers it mirrors.
<!-- PULLFROG_DIVIDER_DO_NOT_REMOVE_PLZ -->
<sup><a href="https://pullfrog.com"><picture><source media="(prefers-color-scheme: dark)" srcset="https://pullfrog.com/logos/frog-white-full-18px.png"><img src="https://pullfrog.com/logos/frog-green-full-18px.png" width="9px" height="9px" style="vertical-align: middle; " alt="Pullfrog"></picture></a> | [Fix all ➔](https://pullfrog.com/trigger/stablyai/orca/21032?action=fix&review_id=5222494889) | [Fix 👍s ➔](https://pullfrog.com/trigger/stablyai/orca/21032?action=fix-approved&review_id=5222494889) | [View workflow run](https://github.com/stablyai/orca/actions/runs/35093882008/job/104786387378) | Using `DeepSeek Flash` (free via [Pullfrog for OSS](https://pullfrog.com/for-oss)) | [𝕏](https://x.com/pullfrogai)</sup>| { | ||
| title: translate( | ||
| 'auto.components.settings.ChatAppearanceSection.fontFamilyTitle', | ||
| 'Chat Font Family' |
There was a problem hiding this comment.
fontFamilyTitle (and fontSizeTitle, lineHeightTitle, fontMonoTitle) is shared with ChatAppearanceSection.tsx, but the English fallbacks differ — 'Chat Font Family' here vs 'Font Family' there. sync:localization-catalog keeps only the first fallback it sees, so the settings row can silently take the search-catalog wording (or vice-versa). Align the fallback strings or give the search entries distinct keys.
|
I'd find this very useful. In dark mode the Chat UI renders |
|
Reopening this: after comparing the implementations, it is not a duplicate. #33687 addresses the same font-family need through the existing |
|
Closing this PR because the linked issue (#20392) was completed via #33687, and |
Why
Every other reading/editing surface in Orca (terminal, Monaco editor, left sidebar) exposes dedicated appearance controls. The native chat UI had none — font, size, line height, and monospace stack were all hard-coded Tailwind classes. The only workaround was application-wide window zoom, which enlarged unrelated UI chrome.
Summary
New settings fields (
GlobalSettings)chatAppearanceMode('default' | 'match-terminal'),chatFontFamily,chatFontSize(9–32 px, default 13),chatLineHeight(1.0–2.5, default 1.4),chatFontMono.CSS variable infrastructure
.native-chat-surfaceclass publishes--chat-font-size,--chat-line-height,--chat-font-familyand remaps every fixed Tailwind text size (.text-sm,.text-xs,.text-[11px],.text-[10px]) proportionally viacalc(var(--chat-font-size) * ratio)so visual balance is maintained at any font size.Terminal theme matching
chatAppearanceMode: 'match-terminal'invokesresolveTerminalSurfaceVariables()(shared with the left sidebar) to project terminal background, foreground, card, accent, muted, and border colors onto the chat surface.Settings UI (Settings → Appearance → Chat)
Documentation
docs/site/content/docs/agents/native-chat.mdx— new## Appearancesection.Tests
58 / 58 tests pass across 4 suites:
ChatAppearanceSection.test.tsx— 8use-native-chat-appearance-style.test.ts— 12AppearancePane.test.tsx— 26NativeChatStructuredSession.test.tsx— 12oxlint— 0 warnings, 0 errors.Issue Number
Fixes #20392