Repository navigation
feat(mobile): light/dark app chrome theme [CHE-1305] - #5
Merged
Merged
Conversation
The mobile app chrome was hardcoded dark. Add a light palette and a theme
context that resolves the effective light/dark scheme from a stored
appearance preference plus the device's OS color scheme, then drive the app
chrome (root Stack screenOptions, home/pairing screen, settings) from it.
- mobile-theme.ts: add `lightColors` alongside `darkColors` with identical
token keys; `colors` still points at the dark palette so unmigrated screens
compile and render dark (the clean dark fallback the AC allows).
- theme-context.tsx: `ThemeProvider` + `useThemeColors()`; resolves 'system'
against React Native `useColorScheme()`, falling back to dark.
- preferences.ts: `appAppearance` ('system' | 'light' | 'dark', default
'system') load/save, following the terminalLinkOpenMode precedent.
- _layout.tsx: wrap the tree in ThemeProvider; Stack screenOptions and the
StatusBar style now read the active palette.
- index.tsx, settings.tsx: consume `useThemeColors()` via a memoized
StyleSheet factory; settings adds a System/Light/Dark control.
Other screens stay on the static dark `colors` fallback (AC-compliant).
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Owner
Author
smk508
pushed a commit
that referenced
this pull request
Jul 22, 2026
* Restructure mobile pairing setup into a clear stepped layout * Rework mobile pairing UI: radio-style path selector with sign-in gate fo * fix(mobile): resolve mobile-pairing review findings Applies the code-review findings for the reworked pairing UI: - Clear a displayed Relay QR on sign-out in both MobilePage and MobilePane (the rework dropped the wasSignedInRef watcher, leaving a stale Relay QR next to a "sign in required" prompt). Anywhere stays selected; the QR re-mints as local-only. [#1, #3] - Extract useMobilePairingConnectionMode so both panes resolve the saved preference identically instead of duplicating the state + resync effect. [#6] - Delete ~24 i18n keys the rework left unreferenced; sync locale catalogs to parity. [#4] - Give the connection-path radiogroup roving tabindex + arrow-key nav and document why it diverges from SettingsSegmentedControl. [#7] - Add MobilePane.test.tsx (previously untested safety logic) and a MobilePage saved-local-only restore test. [#2, #5] Verified: 22 targeted tests pass, typecheck + oxlint clean, localization catalog/coverage and max-lines ratchet green. * fix(mobile): resolve adversarial-review findings for pairing UI Address accepted findings from the mobile pairing UI rework: - MobilePane: add a request-generation epoch so a late getPairingQR response can't paint a stale Relay QR after sign-out, a mode switch, or an address change; arm rotation when discarding a pending mint. - MobilePage: on sign-in, upgrade a signed-out local-only fallback QR to Relay (invalidate + rotate-regenerate); handle null->connected too. - Extract useMobilePairingQrInvalidation so both sign-in/out edges and cross-window preference syncs invalidate/re-mint the QR consistently. - MobilePane: clear + rotate the QR when the selected address changes (manual pick or refresh-driven) so it can't encode the old endpoint. - MobilePairingConnectionOptions: guard the Sign in CTA on configured; show an Unavailable panel on unconfigured builds instead of dead CTA. - Drop the duplicate sign-in helper from MobilePairingSetupSection. - Remove dead i18n keys (title, recommended, signInToGenerate) and add relayUnavailable across all locale catalogs. - Add tests: deferred sign-out/mode-switch races, sign-in upgrade, cross-window sync, unconfigured build, arrow-key radiogroup. TODO left for the relay-label-honesty finding: getPairingQR does not expose the actually-encoded mode when an automatic offer degrades to local-only, so the mismatch can't be surfaced without a new return field. * fix(mobile): resolve relay-pairing deep-review regressions - MobilePane: invalidatePairing now clears loading so a superseded mid-flight generate can't wedge Generate disabled forever - MobilePage: stop auto-minting a local-only QR under the Relay label when signed out with Anywhere; gate Step 2 auto-generate and the Generate button on a shared canMintMobilePairingOffer helper, align with Settings, clear QR + loading on sign-out, mint Relay on sign-in - qr-invalidation: clear pairQrDataUrl (and loading) on every invalidation path so a stale QR can't stay scannable during rotation - Strengthen MobilePane/MobilePage tests for the aligned behavior and stuck-loading coverage - Translate relayUnavailable in es/ja/ko/zh Co-authored-by: Orca <[email protected]> * fix(mobile): refuse to mint QR when signed-out with Anywhere selected Replace silent degradation of Anywhere mode to local-only QR with explicit refusal. Add canMintMobilePairingOffer guard across all mint paths (address change, network invalidation, connection mode switch). This ensures the UI honestly encodes the selected pairing path. Improve keyboard focus visibility on the path selector by adding a persistent focus ring. * fix(mobile): detect and flag Relay provisioning degradation When Relay provisioning fails during automatic (Anywhere) pairing offer creation, the offer silently degrades to local-only. This confuses users who selected Anywhere expecting cellular capability. Add connectionMode field to the pairing offer result to expose what the offer actually encodes. The UI now flags degradation when the offered mode mismatches the user's selection. Also move credential rotation logic to the main process: rotate when requested mode differs from the pending token's encoded mode. This ensures QR codes displayed under an old policy can't pair under a new one, and windows reminting after preference sync converge on one token. Rename MobileRelayBetaAvailability → MobileRelayBetaNotice. * test(mobile): verify pairing codes don't flash during Relay mint Assert that the pairing QR and URL remain hidden while the Relay mint is pending, preventing confusing intermediate states when signing in unlocks Relay. --------- Co-authored-by: Orca <[email protected]>
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.


What changed
The Orca mobile app chrome was hardcoded to the dark palette. This adds a light theme and drives the app chrome from a theme context that resolves the effective scheme from a stored appearance preference plus the device's OS color scheme.
mobile-theme.ts— addslightColorsalongsidedarkColors, both typed against a sharedThemeColorscontract (identical token keys). Syntax/terminal tokens stay dark-optimized (the terminal WebView and code surfaces remain dark regardless of app chrome). The existingcolorsexport still points at the dark palette.theme-context.tsx(new) —ThemeProvider+useThemeColors()/useTheme(). Resolves'system'against React NativeuseColorScheme(), falling back to dark when the OS scheme is unavailable.preferences.ts—appAppearancepreference ('system' | 'light' | 'dark', default'system') with load/save following theterminalLinkOpenModeprecedent. Unit-tested._layout.tsx— wraps the tree inThemeProvider; the rootStackscreenOptions(header/content) and theStatusBarstyle now read the active palette.index.tsx(home/pairing screen) andsettings.tsx— migrated touseThemeColors()via a memoizedStyleSheetfactory. Settings gains a System / Light / Dark control that reads/writes the preference.Migrated screens (themed; safe to screenshot in both modes)
app/index.tsx— home / "Connect your desktop" pairing screen (the default visible screen)app/settings.tsx— settings, incl. the new appearance controlStackheader + content background + status barDark fallback (AC-compliant)
The other ~10 screens still import the static
colors(dark) export and render dark in all modes. The AC explicitly allows a clean dark fallback for unmigrated screens — they don't break, they just don't yet follow the light preference.Verification
Mobile has its own gates (the root harness doesn't cover
mobile/); all green frommobile/:pnpm lint(oxlint) — cleanpnpm test(vitest) — 964 passed, 2 skipped (incl. newappAppearancepreference tests)pnpm exec tsc --noEmit— cleanLight/dark verification screenshots will be attached separately.
🤖 Generated with Claude Code