Repository navigation
fix(mobile): improve secondary text contrast - #11651
Conversation
📝 WalkthroughWalkthroughUpdated mobile secondary and muted text colors, then added Vitest coverage that calculates WCAG contrast ratios. The tests verify muted text meets a 4.5:1 ratio on standard dark surfaces and that secondary text has higher contrast than muted text on the panel background. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
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 |
Greptile SummaryThis PR raises the mobile
Confidence Score: 4/5Safe to merge — the token changes are straightforward lightness bumps with no API surface impact, and the new tests confirm all updated values clear the WCAG AA threshold. The color changes are correct and well-justified by the contrast math. The only gap is that the test suite verifies textSecondary only via a relative hierarchy check rather than an absolute contrast floor, leaving a small blind spot for future edits. Files Needing Attention: mobile/src/theme/mobile-theme-contrast.test.ts — the second test could be extended to assert an absolute 4.5:1 minimum for textSecondary on all dark surfaces, not just hierarchy relative to textMuted.
|
| Filename | Overview |
|---|---|
| mobile/src/theme/mobile-theme.ts | Raised textSecondary from #888888 to #a1a1a1 and textMuted from #555555 to #8c8c8c; all other tokens unchanged. Computed contrast ratios confirm the new values meet WCAG AA (4.5:1) on every dark surface. |
| mobile/src/theme/mobile-theme-contrast.test.ts | New vitest file implementing WCAG contrast-ratio math and two assertions; textMuted is verified against all three dark surfaces, but textSecondary is only checked for hierarchy relative to textMuted, not against an absolute 4.5:1 floor. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["Text Token"] --> B{Which token?}
B --> C["textPrimary\n#e0e0e0\nunchanged"]
B --> D["textSecondary\n#888888 to #a1a1a1\n~4.4:1 to ~6.7:1 on bgPanel"]
B --> E["textMuted\n#555555 to #8c8c8c\n~2.1:1 to ~5.2:1 on bgPanel"]
D --> F{WCAG AA on all surfaces?}
E --> F
F -->|Pass| G["bgBase #111111\ntextMuted: ~5.6:1\ntextSecondary: ~7.3:1"]
F -->|Pass| H["bgPanel #1a1a1a\ntextMuted: ~5.2:1\ntextSecondary: ~6.7:1"]
F -->|Pass| I["bgRaised #242424\ntextMuted: ~4.6:1\ntextSecondary: ~6.0:1"]
Reviews (1): Last reviewed commit: "fix(mobile): improve secondary text cont..." | Re-trigger Greptile
| it('keeps muted text readable on every standard dark surface', () => { | ||
| for (const surface of [colors.bgBase, colors.bgPanel, colors.bgRaised]) { | ||
| expect(contrastRatio(colors.textMuted, surface)).toBeGreaterThanOrEqual(4.5) | ||
| } | ||
| }) |
There was a problem hiding this comment.
The second test only asserts that
textSecondary has a higher contrast ratio than textMuted against bgPanel, but never checks that textSecondary itself meets the 4.5:1 floor on any surface. Right now the values are safely above threshold, but a future edit that darkens textSecondary while preserving the hierarchy (e.g., textSecondary at 4.6:1 and textMuted at 4.5:1) would pass this test even if textSecondary fails on other surfaces. Extending the first loop to cover textSecondary as well guards against this.
| it('keeps muted text readable on every standard dark surface', () => { | |
| for (const surface of [colors.bgBase, colors.bgPanel, colors.bgRaised]) { | |
| expect(contrastRatio(colors.textMuted, surface)).toBeGreaterThanOrEqual(4.5) | |
| } | |
| }) | |
| it('keeps muted text readable on every standard dark surface', () => { | |
| for (const surface of [colors.bgBase, colors.bgPanel, colors.bgRaised]) { | |
| expect(contrastRatio(colors.textMuted, surface)).toBeGreaterThanOrEqual(4.5) | |
| expect(contrastRatio(colors.textSecondary, surface)).toBeGreaterThanOrEqual(4.5) | |
| } | |
| }) |
Rendered QA evidenceElectron-rendered Expo web fallback from head The rendered DOM reports secondary text as Native-device gap: the only approved QA-iPad ( |
Regenerate unthemed-color-imports from listBareColorsImporters on the consolidated tree (161 bare importers). Raise dark textMuted/secondary contrast floors to match stablyai#11651's readable dark tokens.







Summary
Small secondary labels, metadata, and hints in Orca Mobile are now easier to read on the dark graphite surfaces. This raises the existing shared secondary and muted text tokens while preserving the current typography, spacing, and visual hierarchy, and adds focused contrast regression coverage.
Before / after
Screenshots
Full six-shot exact-head iPhone evidence, including light/dark onboarding, scanner, and expanded troubleshooting states: #11651 (comment)
Light appearance:

Dark appearance:

Native QA gap
A Release build from exact head
0d665345898ce2b794aa57a0ab356ea4be505353was installed and exercised on iPhone simulator50FD514C-96F6-446E-AC90-D07A24CAB3A0in both system light and dark appearances. Onboarding, scanner instructions and chrome, troubleshooting labels/icons/body copy, and the pairing-code drawer remained readable. Repeated open/dismiss/reopen, expanded/collapsed content, placeholder and disabled/enabled action states, scrolling, portrait/landscape rotation, the light-appearance software keyboard, AX hierarchy, clipping, visible jank, and adjacent regressions all passed in the exercised screens.Android, a physical iPhone, spoken VoiceOver, and paired/authenticated workspace, session, file, and source-control screens were not exercised in this recovery lane. The software keyboard did not reappear in dark appearance after it had been exercised in light; the surrounding dark state and AX hierarchy were still checked.
Testing
0d665345898ce2b794aa57a0ab356ea4be505353; freshly fetched currentorigin/mainisd34bbd7917b3afde4c164ee7338dae4bf1e5818a;git merge-tree --write-tree origin/main HEADcompleted without conflicts and produced treeb22b06baf513d6a564c100ce809d7d8bdad9f9dd.git diff --check, tracked lockfile audit, index audit, and worktree status are clean.AI Review Report
This was a direct non-formal recovery review by one owner; no formal dispatch or orchestration provenance is claimed. The exact diff, native result, AX evidence, interaction states, CI, and current-main integration were reviewed with no scoped blocker found. Greptile reported the change safe to merge with 4/5 confidence and suggested optional future absolute assertions for secondary text; the measured secondary ratios above already clear 4.5:1 on all three surfaces. The earlier CodeRabbit description-template warning is addressed by this complete body.
Security Audit
No security issue was found in the scoped review. The PR changes two presentation tokens and adds pure contrast tests; it does not add dependencies, permissions, network calls, credential handling, data storage, shell execution, or platform-specific behavior.
Notes
96e5a6b25cee1567ac1e1ed70a4c1e09942e1d2cd2c08c9acd57ba01739aedca.