Skip to content

fix(mobile): improve secondary text contrast - #11651

Merged
brennanb2025 merged 1 commit into
mainfrom
brennanb2025/mobile-muted-text-contrast
Aug 2, 2026
Merged

brennanb2025 merged 1 commit into
mainfrom
brennanb2025/mobile-muted-text-contrast

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Before: muted 11–12 px text measured roughly 2.1–2.5:1 on common mobile surfaces and could disappear into cards and page backgrounds.
  • After: muted text measures 5.62:1 on the base surface, 5.18:1 on panels, and 4.62:1 on raised surfaces. Secondary text measures 7.31:1, 6.74:1, and 6.01:1 on the same surfaces.
  • The text remains visually subordinate to primary content while clearing the 4.5:1 target on every standard mobile surface.

Screenshots

Full six-shot exact-head iPhone evidence, including light/dark onboarding, scanner, and expanded troubleshooting states: #11651 (comment)

Light appearance:
Light iPhone troubleshooting state

Dark appearance:
Dark iPhone troubleshooting state

Native QA gap

A Release build from exact head 0d665345898ce2b794aa57a0ab356ea4be505353 was installed and exercised on iPhone simulator 50FD514C-96F6-446E-AC90-D07A24CAB3A0 in 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

  • Focused muted/secondary contrast tests: 2/2 passed.
  • Mobile typecheck passed.
  • Mobile lint passed.
  • Mobile format check passed.
  • Exact-head native Release build, install, launch, interaction, rotation, screenshot, and AX inspection passed on the assigned iPhone simulator.
  • All reported CI checks pass, including Mobile Checks, static analysis, typecheck, Git compatibility, shell contracts, Node 24/26 test shards, macOS/Windows packaging, and Greptile Review. The e2e job is intentionally skipped after the e2e path detector passed.
  • Fresh integration proof: PR head/local HEAD/fetched PR ref are all 0d665345898ce2b794aa57a0ab356ea4be505353; freshly fetched current origin/main is d34bbd7917b3afde4c164ee7338dae4bf1e5818a; git merge-tree --write-tree origin/main HEAD completed without conflicts and produced tree b22b06baf513d6a564c100ce809d7d8bdad9f9dd.
  • 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

@coderabbitai

coderabbitai Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Updated 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)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the primary change: improving secondary text contrast in the mobile theme.
Description check ✅ Passed The description includes all required sections and provides clear change details, testing evidence, review findings, security coverage, and platform notes.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Jul 31, 2026

Copy link
Copy Markdown

Greptile Summary

This PR raises the mobile textSecondary token from #888888 to #a1a1a1 and textMuted from #555555 to #8c8c8c, restoring WCAG AA contrast on dark surfaces where the prior values measured roughly 2.1–2.5:1. A new vitest file provides regression coverage using a correct sRGB-linearization luminance formula.

  • Token changes (mobile-theme.ts): Both secondary and muted text colors are brightened; all other tokens are untouched. Manual verification confirms textMuted at ≥ 4.6:1 on the darkest standard surface (bgRaised).
  • Contrast tests (mobile-theme-contrast.test.ts): textMuted is checked against all three background surfaces at the 4.5:1 floor; textSecondary is only tested for hierarchy relative to textMuted, not for its own absolute threshold — a minor gap worth closing.

Confidence Score: 4/5

Safe 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.

Important Files Changed

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"]
Loading

Reviews (1): Last reviewed commit: "fix(mobile): improve secondary text cont..." | Re-trigger Greptile

Comment on lines +27 to +31
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)
}
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

Suggested change
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)
}
})

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Rendered QA evidence

Electron-rendered Expo web fallback from head 0d665345 (no simulator/device used):

Orca mobile connect screen with updated secondary and muted text

The rendered DOM reports secondary text as rgb(161, 161, 161) and muted text as rgb(140, 140, 140), matching #a1a1a1 and #8c8c8c. Focused contrast tests, mobile typecheck, lint, formatting, the full 2,756-test mobile suite, and the final diff review are clean.

Native-device gap: the only approved QA-iPad (C589AF84-2F0C-4978-952B-748933DE6804) remained occupied by an unrelated albacore process, so no simulator command or native screenshot was taken; the prohibited device was untouched.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Direct non-formal recovery QA — exact head 0d665345898ce2b794aa57a0ab356ea4be505353

Reviewed directly in child worktree mobile-muted-text-contrast; no formal dispatch or orchestration provenance is claimed.

Native Release build was built from the exact PR head, installed, and launched on iPhone simulator 50FD514C-96F6-446E-AC90-D07A24CAB3A0 through the version-matched Orca emulator workflow on port 3100. Embedded bundle SHA-256: 96e5a6b25cee1567ac1e1ed70a4c1e09942e1d2cd2c08c9acd57ba01739aedca.

Result

  • PASS in system light and dark appearances for onboarding copy, scanner instructions/chrome, troubleshooting labels/icons/body copy, and the pairing-code drawer.
  • PASS for repeated open/dismiss/reopen, expanded/collapsed troubleshooting, placeholder and disabled/enabled action states, scrolling, portrait/landscape rotation, and the software keyboard where available.
  • PASS for AX inspection, hierarchy/readability, clipping, visible jank, and adjacent regressions in the exercised native screens.
  • Muted contrast: base 5.62:1, panel 5.18:1, raised 4.62:1.
  • Secondary contrast: base 7.31:1, panel 6.74:1, raised 6.01:1.
  • No scoped integration defect found; no code change or push was made.

Exact-head local checks

  • Focused muted/secondary contrast tests: 2/2 passed.
  • Mobile typecheck passed.
  • Mobile lint passed.
  • Mobile format check passed.
  • git diff --check passed.

Evidence

Light onboarding:
Light onboarding

Dark onboarding:
Dark onboarding

Light scanner:
Light scanner

Dark scanner:
Dark scanner

Light troubleshooting expanded:
Light troubleshooting expanded

Dark troubleshooting expanded:
Dark troubleshooting expanded

Remaining native gaps

Android, a physical iPhone, spoken VoiceOver, and paired/authenticated workspace/session/file/source-control screens were not exercised in this simulator recovery lane. The dark-appearance software keyboard did not reappear after it had been exercised in light appearance; the surrounding dark state and AX hierarchy were still checked.

@brennanb2025
brennanb2025 merged commit b07dce7 into main Aug 2, 2026
44 checks passed
bbingz added a commit to bbingz/orca that referenced this pull request Aug 6, 2026
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.
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant