Skip to content

feat(mobile): add the light palette and the dark/light alias - #10422

Closed
bbingz wants to merge 2 commits into
stablyai:mainfrom
bbingz:feat/mobile-light-palette
Closed

bbingz wants to merge 2 commits into
stablyai:mainfrom
bbingz:feat/mobile-light-palette

Conversation

@bbingz

@bbingz bbingz commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds the light half of the mobile palette. Nothing renders differently — export const colors = darkColors stays, so every one of the ~157 files importing colors keeps compiling and keeps rendering exactly as today. This PR only makes the light values exist, with a test net around them.

Where the values come from

Every light value is derived token by token from the desktop's canonical light tokens in src/renderer/src/assets/main.css, and each carries its source line as a comment. Two worth calling out because they are easy to get wrong:

  • textPrimary: #0a0a0a from --foreground, not --primary #171717 — --primary is a surface token, and using it makes body text muddy.
  • bgRaised: #eaeaea from --worktree-sidebar-accent, because --accent in light mode collapses into bgPanel.

Three values are marked INVENTED in the source because no desktop counterpart exists (textMuted, statusAmber, and the diff-wash alpha). docs/STYLEGUIDE.md says to ask rather than invent silently, so they are labelled with the rule each follows rather than slipped in.

Tests — mobile's first theme tests

There were none before. This adds three:

  • palette parity — every dark key has a light key and vice versa, so a token added to one palette cannot silently miss the other
  • contrast — computes real WCAG ratios for the foreground/background pairs. Nine light pairs land below 4.5:1; every one has a dark counterpart at or below the same number, so none is a light-mode regression, and the test pins them so they cannot get worse
  • an import ratchet — the list of files still importing the un-themed colors may only shrink. This is what makes the migration incremental instead of one 150-file commit: unconverted files keep rendering dark, and the ratchet stops new ones being added

The alias trades a compiler guarantee for a test guarantee, deliberately and temporarily; the final PR of this series deletes export const colors and typecheck becomes the completeness proof again.

Context

Part of a series bringing light mode to Orca mobile in reviewable slices. Nothing is user-visible until the final PR flips the switch, and the chain can stop after any PR without leaving the app half-lit.

ELI5

Adds the light-mode color palette for mobile, taken from desktop tokens. The app still uses dark colors everywhere so nothing looks different yet; this only makes light values available for the upcoming theme switch.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The mobile theme now exposes typed dark and light palettes, adds a pressed surface token, and retains the legacy colors alias. NewWorkspaceFab uses the new token for its pressed background. New tests validate palette keys, formatting, cross-mode differences, contrast ratios, themed style factory output, and restrictions on unthemed color imports and inline themed-style factories.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the summary and tests, but it omits required template sections like Screenshots, AI Review Report, Security Audit, and Notes. Add the missing headings and fill them in, including screenshots or 'No visual change', testing status, review/security summaries, and notes.
✅ Passed checks (4 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 matches the main change: adding the mobile light palette and the dark/light alias.

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 001dd847-b083-4d14-bd06-ae9b756faa8e

📥 Commits

Reviewing files that changed from the base of the PR and between 17959a2 and 18ccc8bbac8d018806c3f0462c1905d42857c344.

📒 Files selected for processing (5)
  • mobile/src/components/NewWorkspaceFab.tsx
  • mobile/src/theme/mobile-theme-palette.test.ts
  • mobile/src/theme/mobile-theme.ts
  • mobile/src/theme/themed-style-factories.test.ts
  • mobile/src/theme/unthemed-color-imports.test.ts

@AmethystLiang
AmethystLiang requested a review from OrcaWin July 24, 2026 16:48
@bbingz
bbingz force-pushed the feat/mobile-light-palette branch 2 times, most recently from eff0e62 to fc5fc45 Compare July 25, 2026 04:49

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f691b423-4627-4c0f-92a4-2528d2e804d5

📥 Commits

Reviewing files that changed from the base of the PR and between eff0e6201a19aa39a3e6ba5b3c0a2ba121c668f5 and fc5fc45.

📒 Files selected for processing (5)
  • mobile/src/components/NewWorkspaceFab.tsx
  • mobile/src/theme/mobile-theme-palette.test.ts
  • mobile/src/theme/mobile-theme.ts
  • mobile/src/theme/themed-style-factories.test.ts
  • mobile/src/theme/unthemed-color-imports.test.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • mobile/src/components/NewWorkspaceFab.tsx
  • mobile/src/theme/mobile-theme.ts
  • mobile/src/theme/mobile-theme-palette.test.ts

@bbingz

bbingz commented Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (e1eca7f31). Clean replay of the light-palette commit.

Also addressed CodeRabbit where it applies to this PR:

  • INLINE_THEMED_STYLES now matches unparenthesized arrow factories (colors => …)
  • factory suite asserts the registry starts empty (intentional seed; conversion batches append)

Deferred: immutable ratchet baseline vs main history (heavy / process-enforced). Visible behaviour still unchanged (colors = darkColors).

Verified: palette + factories + unthemed ratchet (10/10).

@bbingz
bbingz force-pushed the feat/mobile-light-palette branch from fc5fc45 to 9f7242e Compare July 25, 2026 09:33
bbingz added 2 commits July 25, 2026 17:43
Rename the existing tokens to darkColors, add lightColors (31 keys)
derived from the desktop light tokens, and keep `export const colors =
darkColors` so unconverted modules keep compiling and rendering dark.
Pin the NewWorkspaceFab pressed state to surfaceBrightPressed (byte-
identical in dark). Seed the unthemed-import ratchet and an empty
themed-style-factories suite for the migration batches.
Catch unparenthesized useThemedStyles arrow factories in the ratchet, and
assert the themed-style factory registry starts empty so later conversion
batches must register deliberately rather than leaving a vacuous suite.
@bbingz
bbingz force-pushed the feat/mobile-light-palette branch from 9f7242e to da5ed23 Compare July 25, 2026 09:43
@bbingz

bbingz commented Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

Catch-up rebase onto latest main (no content change) so #10423 can stack cleanly.

@bbingz

bbingz commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Consolidated into #10423 (light/dark theme runtime foundation, Part of #9959), with the dark palette re-based on #11651's updated values and the unthemed-color ratchet regenerated against current main. Closing.

@bbingz bbingz closed this Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants