Add regional typography controls / 新增分区域字体设置#6634
Merged
SivanCola merged 4 commits intoJul 18, 2026
Merged
Conversation
Problem: Users can only change one global font family and text scale, so conversation, composer, code, metadata, and navigation cannot be tuned independently. Assistant response styles can also override the selected conversation typography. Root cause: The frontend exposes a single global typography layer, while higher-specificity theme rules hardcode assistant response font properties. Fix: Add persisted, backward-compatible typography preferences and a detailed settings view for five semantic regions. Route each region through CSS custom properties, localize the UI, and make assistant responses inherit the conversation font and size. Verification: - pnpm --dir desktop/frontend exec tsx src/__tests__/typography-preferences.test.ts - pnpm --dir desktop/frontend exec tsx src/__tests__/typography-overflow-contract.test.ts - pnpm --dir desktop/frontend typecheck - pnpm --dir desktop/frontend check:css - pnpm --dir desktop/frontend build - Browser computed styles confirm matching user and assistant typography
Problem: Regional typography settings could be ignored by assistant replies, code/tool content, and metadata. The theme restore copy also implied a broader reset than it performs. Root cause: Root-scoped typography tokens were computed before descendant region scales, and later theme selectors overrode regional font values. Custom font input could also diverge from its normalized persisted value, while restore labels did not name the Graphite-only scope. Fix: Expose exact per-region size properties, recompute semantic typography tokens at each region, route late selectors through regional variables, normalize custom font input before state updates, and clarify/localize the Graphite restore copy while preserving detailed typography. Verification: - pnpm --dir desktop/frontend test - pnpm --dir desktop/frontend test:typecheck - pnpm --dir desktop/frontend build - Browser checks confirmed user and assistant replies render at 24px and remain 24px after restoring the Graphite appearance.
Problem: Supporting-text customization changed the effective default from 12px to 11px, and code/metadata previews did not match their applied sizes. Root cause: The metadata region used an 11px scaling base while the existing status token uses 12px. The preview also multiplied every region by a hardcoded 14px base. Fix: Align metadata with the 12px supporting-text base and give each preview region an exact size variable with the correct global fallback. Verification: - pnpm --dir desktop/frontend test - pnpm --dir desktop/frontend check:css - pnpm --dir desktop/frontend test:typecheck - pnpm --dir desktop/frontend build - Browser computed-style checks confirmed code and metadata previews match their configured sizes and metadata stays 12px when leaving follow-global.
Problem: Diff text stayed at 12.5px while the code and tools region followed a non-default global text size. Root cause: The diff fallback bypassed the global font scale and only read the exact regional override. Fix: Scale the legacy 12.5px diff base by the global text-size token until the code region is customized, and lock the behavior with a CSS contract test. Verification: - pnpm --dir desktop/frontend exec tsx src/__tests__/typography-overflow-contract.test.ts - pnpm --dir desktop/frontend check:css - pnpm --dir desktop/frontend test:typecheck - pnpm --dir desktop/frontend build
SivanCola
marked this pull request as ready for review
July 18, 2026 14:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why
The existing global font and text-size controls cannot accommodate users who need larger conversation text without enlarging navigation, code, or metadata. Theme-specific assistant response rules also override the selected conversation typography, causing user messages and replies to render at different sizes.
User impact
Users can tune readability by semantic area, preview changes immediately, and return any region or the entire page to the global defaults. Existing installations retain their current appearance until a region is explicitly customized.
Backward compatibility
reasonix-region-typography-v1local preferenceVerification
pnpm --dir desktop/frontend testpnpm --dir desktop/frontend typecheckpnpm --dir desktop/frontend check:csspnpm --dir desktop/frontend build