Skip to content

fix(code-appearance): unify fonts and selection highlights - #1822

Merged
FresnelR27 merged 1 commit into
org2AI:developfrom
Harry19081:dev/code-appearance-consistency
Sep 15, 2026
Merged

FresnelR27 merged 1 commit into
org2AI:developfrom
Harry19081:dev/code-appearance-consistency

Conversation

@Harry19081

Copy link
Copy Markdown
Member

Problem

Code and terminal surfaces use different font defaults and selection colors. The interactive terminal prefers Hack, read-only xterm output falls back to its built-in font, and several diff selections use gray instead of the chat selection color. Dark-theme body declarations can also override the user's code-font choice.

Solution

Unify code-surface appearance through the existing font setting and chat selection token:

  • Use one system monospace stack for CodeMirror, terminal/replay surfaces, code blocks, and Tailwind monospace utilities. Preserve explicit font choices and existing size/line-height preferences; normalize regular text to weight 400 and retain bold emphasis.
  • Remove the separate terminal font resolver and the dark-theme font override. Update read-only xterm fonts in place, refit after changes, and cancel pending refits on unmount.
  • Match editor, diff, search, and focused/inactive terminal highlights to the chat selection color in base themes and generated skins. Keep an outline on the active editor search result.
  • Add regression coverage for settings/CSS parity, skin selection parity, terminal color resolution, and terminal font-update cleanup.

Potential risks

System font availability varies by OS and can change glyph widths, wrapping, and terminal column counts. Fonts are resolved locally without adding bundled assets or downloads; Hack remains selectable. Search highlights and inactive terminal selections change visually, while syntax colors and semantic added/deleted diff colors retain their roles.

Native screenshots, multi-window behavior, and CPU/RSS measurements were not collected because desktop control requires explicit opt-in. The focused tests use jsdom and mocked xterm rendering, so they do not prove native glyph appearance. No dependency, settings schema, persistence format, or wire changes are included. Revert this commit to restore the previous appearance defaults.

Verification

On an isolated branch based on the latest develop:

  • pnpm typecheck:fast — passed
  • Focused tests below — 53 passed across 11 files; jsdom emitted its canvas-not-implemented notice
  • npx lint-staged (commit hook: Oxlint, ESLint, Prettier) — passed
  • npx tsgo --noEmit --pretty false (commit hook) — passed
  • PostCSS/Tailwind compilation verified .font-mono uses var(--code-font-family); Sass compilation passed for the changed Markdown, code-viewer, and diff styles
  • git diff --check — passed
  • Full production build and native visual/performance checks were not run
pnpm test \
  src/store/ui/__tests__/editorSettingsAtom.test.ts \
  src/config/appearance/skins/deriveSkinTokens.test.ts \
  src/config/appearance/skins/rootAliasParity.test.ts \
  src/engines/TerminalCore/components/TerminalInteractive/utils/theme.test.ts \
  src/util/ui/theme/__tests__/selectionTokenParity.test.ts \
  src/engines/ChatPanel/ChatHistory/selectionStyles.test.ts \
  src/features/CodeMirror/config/themeConfig.test.ts \
  src/features/CodeMirror/Diff/reviewSearchNavigation.test.ts \
  src/engines/TerminalCore/components/XtermOutput/XtermOutput.test.ts \
  src/engines/TerminalCore/__tests__/TerminalCore.test.ts \
  src/components/MarkDown/markdownLinkCodeStyles.test.ts

Architecture and lifecycle findings are recorded in docs/org2-performance-guard-2026-09-15/CodeTypography.md. The UI audit's pure-styling exclusion applies; no action controls or component structure changed.

@FresnelR27
FresnelR27 merged commit 897aa72 into org2AI:develop Sep 15, 2026
14 checks passed
@Harry19081 Harry19081 added UX Improvements to user experience, workflow smoothness frontend-ui Frontend UI, design system, accessibility, layout, or theming labels Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend-ui Frontend UI, design system, accessibility, layout, or theming UX Improvements to user experience, workflow smoothness

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants