feat(ui): add UI text-size scaling and high-contrast mode#831
Conversation
roborev: Combined Review (
|
Add two Settings -> Appearance accessibility controls, both persisted in localStorage: - Text size (90-130%): a uniform UI scale applied as a composed root zoom on documentElement. On the web it scales by the font setting; on desktop it multiplies with the existing window zoom, rounded to 4 decimals. - High contrast: a high-contrast root class driving :root.high-contrast and :root.dark.high-contrast overrides of the neutral text/border tokens plus a strengthened focus ring, raising the shell and transcript toward WCAG AA. Colocated overrides cover the literal-colored CallGroup, SubagentCalls, and CallRow transcript components. Data-visualization and category identity colors are left unchanged.
5659a00 to
61a097c
Compare
|
tested locally, will merge when CI green |
roborev: Combined Review (
|
Dark high-contrast mode intentionally lightens the link and focus accent, but filled controls reused that same accent with hard-coded white text. That made prominent actions and text selection lower contrast than the default theme in the accessibility mode. Add a foreground token for accent-blue fills so dark themes can pair the light accent with dark text while preserving the existing accent color for links, focus rings, and visual identity.
roborev: Combined Review (
|
The accent foreground token fixed direct blue filled controls, but agent and role surfaces can receive the same blue through dynamic helpers and custom properties. In dark high-contrast mode those paths still paired the light blue fill with white text or icons. Centralize the foreground decision for blue agent fills and pass it through the breadcrumb, message role icon, and filter checkmark surfaces so fallback and Claude-colored labels keep the same contrast guarantees as primary controls.
roborev: Combined Review (
|
Dark high-contrast mode makes the accent palette light, so a blue-only foreground special case left purple, green, and other filled accent surfaces paired with white text. Role icons and dynamic agent badges need to derive foregrounds from the same accent contract as primary controls. Define foreground tokens for the accent palette and route agent, role, and selected-filter foregrounds through those tokens so future accent-colored agents do not reintroduce the same contrast bug.
roborev: Combined Review (
|
Accent foreground tokens only help if filled controls actually use them. A few component-local accent fills still hard-coded white text, including the insights generate action, so dark high-contrast could still render low-contrast labels. Add a component source guard for hard-coded white foregrounds on accent-filled styles and route the remaining offenders through the matching accent foreground tokens.
roborev: Combined Review (
|
Adds two Settings -> Appearance accessibility controls, both persisted in localStorage. Frontend-only.
Text size (90-130%)
A uniform UI scale that reuses the existing root-zoom mechanism: one effect sets
document.documentElement.style.zoomto the font scale composed with the desktop window zoom --(IS_DESKTOP ? zoomLevel/100 : 1) * (fontScale/100), rounded to 4 decimals. On the web only the font scale applies; on desktop the two multiply.agentsview-font-scalepersists everywhere; the desktopagentsview-zoom-levelstays desktop-only.High contrast
A
high-contrastroot class (composing with light/dark) drives:root.high-contrastand:root.dark.high-contrastoverrides of the neutral text/border tokens and--accent-blue, plus a strengthened focus ring. Every overridden token clears WCAG AA against the real backgrounds. The shell and the token-driven majority of the transcript are covered by the token overrides; the three literal-colored transcript components (CallGroup, SubagentCalls, CallRow) get colocated:global(.high-contrast)overrides. Data-visualization palettes and category identity colors (--cat-*) are left unchanged so their encoded meaning is preserved.Where to look
frontend/src/lib/stores/ui.svelte.ts-- state, setters, the composed-zoom and high-contrast effects, and the persistence split.frontend/src/app.css-- high-contrast token overrides and focus ring.frontend/src/lib/components/settings/AppearanceSettings.svelte-- the controls.Note
This branch and #821 both edit
ui.svelte.tsin adjacent regions; whichever merges second may need a small conflict resolution.