Skip to content

feat(app): add System / Light / Dark appearance setting on mobile - #19378

Merged
Git-on-my-level merged 8 commits into
mainfrom
feat/mobile-theme-toggle
Sep 27, 2026
Merged

Git-on-my-level merged 8 commits into
mainfrom
feat/mobile-theme-toggle

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Sep 27, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds an Appearance setting to mobile (Settings → Notifications & Display) with System / Light / Dark, defaulting to System (follows the OS). The choice persists and applies live.

  • Palette: OmiColors (about 1.8k references across 233 files) now resolves each token from an active OmiPalette (dark or light). The app root swaps the palette when the resolved brightness changes and rebuilds the tree, so existing token users flip without per-file edits. const expressions that embedded tokens were un-consted.
  • Dark mode keeps today's colors. test/unit/appearance_test.dart asserts that every dark token equals its original value.
  • Light palette: iOS light system colors (grouped #F2F2F7 page, white cards). The accent stays neutral per INV-UI-1: black with white on-accent text.
  • Theme: buildOmiTheme builds both light and dark ThemeData. The status bar style follows brightness, and the forced-dark Cupertino overrides (text selection, notification picker, action-item form sheet) are now brightness-aware.
  • Migrated to tokens: raw white/black/grey literals on v1 surfaces (home/conversations, conversation detail, chat including markdown and charts, memories, action items, settings, onboarding/auth).
  • Setting: AppearanceProvider plus a SharedPreferencesUtil key. The Settings row is localized in all 49 locales.

Light-mode audit (follow-up commits)

The visual-audit harness can now render light mode (OMI_AUDIT_BRIGHTNESS=light). All 73 production scenarios were rendered in both modes and every light frame was reviewed. Fixed:

  • Material dialog actions (Cancel, Separate, Enable) that were invisible, plus a heavy black frame around the dialog.
  • The invisible snackbar Undo action.
  • Secondary and disabled button fills that disappeared into the page (light surface2/surface3 darkened).
  • The dark home nav bar and fade, and the dark shapes behind the chat composer.
  • The blank call-button icon.
  • The dark Offline Sync and storage cards.
  • Switch tracks that did not show.
  • Memory Graph contrast.
  • Dark transcript bubbles that had black text.

A dark-palette identity test still guards against any dark-mode change.

Known limitations (deferred)

Wrapped 2025, sync diagnostics, third-party WebViews, and native splash/launch screens keep fixed dark styling. Nothing has been verified on a physical device yet.

Product invariants affected

  • INV-UI-1: the neutral accent now reads white-on-black in dark mode and black-on-white in light mode. The purple-literal guard is unchanged and applies to both palettes. brand-ui.md and mobile-ux-contract.md wording is updated; no check is weakened.
  • INV-DATA-1: app/lib/main.dart changes only theme wiring. API and identity routing are unchanged.
  • INV-MEM-1: memory page edits change color/style tokens only. Tier membership, access, and storage are unchanged.

Failure-Class: none

Verification

  • flutter test --no-pub test/unit/appearance_test.dart: 8/8 pass, including the dark palette identity test.
  • app/scripts/analyze_ratchet.sh: passes.
  • python3 app/scripts/l10n.py check: 49 locales OK.
  • The brand-ui, mobile-ux-contract, and line-count ratchets, plus make preflight, pass locally.
  • Light/dark side-by-side renders of home, conversation detail, chat, memories, action items, and settings came from real page widgets with fake data in a gitignored test harness. Not yet verified on a physical device or simulator.

🤖 Generated with Claude Code

Git-on-my-level and others added 8 commits September 27, 2026 15:25
# Conflicts:
#	app/lib/l10n/app_ar.arb
#	app/lib/l10n/app_be.arb
#	app/lib/l10n/app_bg.arb
#	app/lib/l10n/app_bn.arb
#	app/lib/l10n/app_bs.arb
#	app/lib/l10n/app_ca.arb
#	app/lib/l10n/app_cs.arb
#	app/lib/l10n/app_da.arb
#	app/lib/l10n/app_de.arb
#	app/lib/l10n/app_el.arb
#	app/lib/l10n/app_en.arb
#	app/lib/l10n/app_es.arb
#	app/lib/l10n/app_et.arb
#	app/lib/l10n/app_fa.arb
#	app/lib/l10n/app_fi.arb
#	app/lib/l10n/app_fr.arb
#	app/lib/l10n/app_he.arb
#	app/lib/l10n/app_hi.arb
#	app/lib/l10n/app_hr.arb
#	app/lib/l10n/app_hu.arb
#	app/lib/l10n/app_id.arb
#	app/lib/l10n/app_it.arb
#	app/lib/l10n/app_ja.arb
#	app/lib/l10n/app_kn.arb
#	app/lib/l10n/app_ko.arb
#	app/lib/l10n/app_localizations.dart
#	app/lib/l10n/app_localizations_ar.dart
#	app/lib/l10n/app_localizations_be.dart
#	app/lib/l10n/app_localizations_bg.dart
#	app/lib/l10n/app_localizations_bn.dart
#	app/lib/l10n/app_localizations_bs.dart
#	app/lib/l10n/app_localizations_ca.dart
#	app/lib/l10n/app_localizations_cs.dart
#	app/lib/l10n/app_localizations_da.dart
#	app/lib/l10n/app_localizations_de.dart
#	app/lib/l10n/app_localizations_el.dart
#	app/lib/l10n/app_localizations_en.dart
#	app/lib/l10n/app_localizations_es.dart
#	app/lib/l10n/app_localizations_et.dart
#	app/lib/l10n/app_localizations_fa.dart
#	app/lib/l10n/app_localizations_fi.dart
#	app/lib/l10n/app_localizations_fr.dart
#	app/lib/l10n/app_localizations_he.dart
#	app/lib/l10n/app_localizations_hi.dart
#	app/lib/l10n/app_localizations_hr.dart
#	app/lib/l10n/app_localizations_hu.dart
#	app/lib/l10n/app_localizations_id.dart
#	app/lib/l10n/app_localizations_it.dart
#	app/lib/l10n/app_localizations_ja.dart
#	app/lib/l10n/app_localizations_kn.dart
#	app/lib/l10n/app_localizations_ko.dart
#	app/lib/l10n/app_localizations_lt.dart
#	app/lib/l10n/app_localizations_lv.dart
#	app/lib/l10n/app_localizations_mk.dart
#	app/lib/l10n/app_localizations_mr.dart
#	app/lib/l10n/app_localizations_ms.dart
#	app/lib/l10n/app_localizations_nl.dart
#	app/lib/l10n/app_localizations_no.dart
#	app/lib/l10n/app_localizations_pl.dart
#	app/lib/l10n/app_localizations_pt.dart
#	app/lib/l10n/app_localizations_ro.dart
#	app/lib/l10n/app_localizations_ru.dart
#	app/lib/l10n/app_localizations_sk.dart
#	app/lib/l10n/app_localizations_sl.dart
#	app/lib/l10n/app_localizations_sr.dart
#	app/lib/l10n/app_localizations_sv.dart
#	app/lib/l10n/app_localizations_ta.dart
#	app/lib/l10n/app_localizations_te.dart
#	app/lib/l10n/app_localizations_th.dart
#	app/lib/l10n/app_localizations_tl.dart
#	app/lib/l10n/app_localizations_tr.dart
#	app/lib/l10n/app_localizations_uk.dart
#	app/lib/l10n/app_localizations_ur.dart
#	app/lib/l10n/app_localizations_vi.dart
#	app/lib/l10n/app_localizations_zh.dart
#	app/lib/l10n/app_lt.arb
#	app/lib/l10n/app_lv.arb
#	app/lib/l10n/app_mk.arb
#	app/lib/l10n/app_mr.arb
#	app/lib/l10n/app_ms.arb
#	app/lib/l10n/app_nl.arb
#	app/lib/l10n/app_no.arb
#	app/lib/l10n/app_pl.arb
#	app/lib/l10n/app_pt.arb
#	app/lib/l10n/app_ro.arb
#	app/lib/l10n/app_ru.arb
#	app/lib/l10n/app_sk.arb
#	app/lib/l10n/app_sl.arb
#	app/lib/l10n/app_sr.arb
#	app/lib/l10n/app_sv.arb
#	app/lib/l10n/app_ta.arb
#	app/lib/l10n/app_te.arb
#	app/lib/l10n/app_th.arb
#	app/lib/l10n/app_tl.arb
#	app/lib/l10n/app_tr.arb
#	app/lib/l10n/app_uk.arb
#	app/lib/l10n/app_ur.arb
#	app/lib/l10n/app_vi.arb
#	app/lib/l10n/app_zh.arb
#	app/lib/pages/settings/usage_page.dart
Replace the two hardcoded light-mode bubble colours with surface2 and a
pale alpha-blend of the speaker colour, so the mobile UX contract's
colour-literal ratchet stays flat.

Failure-Class: none

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Git-on-my-level
Git-on-my-level merged commit b02a24e into main Sep 27, 2026
44 checks passed
@Git-on-my-level
Git-on-my-level deleted the feat/mobile-theme-toggle branch September 27, 2026 13:27
Git-on-my-level added a commit that referenced this pull request Oct 3, 2026
…mode (#20419)

Offline Sync’s Manage Storage sheet mixed fixed dark card backgrounds
with palette-dependent text, making category labels unreadable in light
appearance and secondary labels too faint in dark appearance. Resolve
card, badge, title and secondary text colors together for both themes.

The extracted production `OfflineSyncStorageSheet` retains the page’s
existing counts, confirmation dialogs and deletion handlers. Category
Clear actions use `OmiButton.secondary` for readable primary text and a
48pt tap target. Titles truncate beside the count; actions move below
the details on narrow sheets or enlarged text.

## Screenshots

Captured on the connected iPhone 16 and Android LAVA LZG411 using
separate debug app identities. The isolated target renders the
production storage sheet and existing Home empty-state widget, with zero
counts or inert sample counts (2 synced / 3 pending). Before uses the
original storage row; after runs the fix. The surrounding fixture is not
the complete Offline Sync or Home page, and no auth, sync or recording
operation is exercised.

| Platform | Light before | Light after | Dark after |
| --- | --- | --- | --- |
| iOS · iPhone 16 | <img
src="https://raw.githubusercontent.com/apoorvdarshan/omi/3ba4d7d7a5c1673366941da95fa377e8b4e20f3d/ios-before.png"
width="240" alt="iOS · iPhone 16 before"> | <img
src="https://raw.githubusercontent.com/apoorvdarshan/omi/3ba4d7d7a5c1673366941da95fa377e8b4e20f3d/ios-after.png"
width="240" alt="iOS · iPhone 16 after"> | <img
src="https://raw.githubusercontent.com/apoorvdarshan/omi/3ba4d7d7a5c1673366941da95fa377e8b4e20f3d/ios-dark-after.png"
width="240" alt="iOS · iPhone 16 dark-after"> |
| Android · LAVA LZG411 | <img
src="https://raw.githubusercontent.com/apoorvdarshan/omi/3ba4d7d7a5c1673366941da95fa377e8b4e20f3d/android-before.png"
width="240" alt="Android · LAVA LZG411 before"> | <img
src="https://raw.githubusercontent.com/apoorvdarshan/omi/3ba4d7d7a5c1673366941da95fa377e8b4e20f3d/android-after.png"
width="240" alt="Android · LAVA LZG411 after"> | <img
src="https://raw.githubusercontent.com/apoorvdarshan/omi/3ba4d7d7a5c1673366941da95fa377e8b4e20f3d/android-dark-after.png"
width="240" alt="Android · LAVA LZG411 dark-after"> |

Nonzero counts show the reviewed Clear actions:

| Platform | Light after | Dark after |
| --- | --- | --- |
| iOS · iPhone 16 | <img
src="https://raw.githubusercontent.com/apoorvdarshan/omi/3ba4d7d7a5c1673366941da95fa377e8b4e20f3d/ios-actions-after.png"
width="240" alt="iOS · iPhone 16 actions-after"> | <img
src="https://raw.githubusercontent.com/apoorvdarshan/omi/3ba4d7d7a5c1673366941da95fa377e8b4e20f3d/ios-actions-dark-after.png"
width="240" alt="iOS · iPhone 16 actions-dark-after"> |
| Android · LAVA LZG411 | <img
src="https://raw.githubusercontent.com/apoorvdarshan/omi/3ba4d7d7a5c1673366941da95fa377e8b4e20f3d/android-actions-after.png"
width="240" alt="Android · LAVA LZG411 actions-after"> | <img
src="https://raw.githubusercontent.com/apoorvdarshan/omi/3ba4d7d7a5c1673366941da95fa377e8b4e20f3d/android-actions-dark-after.png"
width="240" alt="Android · LAVA LZG411 actions-dark-after"> |

The Home empty-state defect already has a merged fix in #20047. Its
existing production widget was checked in both themes; this PR does not
change Home behavior.

## Validation

- Seven focused widget tests passed: category/title/subtitle/count
contrast in both themes, zero-count eligibility, nonzero callbacks, and
a 320px French sheet at 2× text scaling with contrast, minimum target
size and reachability checks. The original row fails the contrast guard
(light title 1.47:1, dark subtitle 3.10:1).
- Physical iOS and Android debug captures visually verified in both
themes. Native iOS button bounds confirm 48pt category targets. Only the
isolated development apps were installed, then removed; production apps
and data were retained and reopened.
- The local iOS fixture artifact omitted the unused unsigned Watch
payload after the native app compiled; no native project or signing
configuration change is included in this PR.
- Pinned Flutter 3.44.5 / Dart 3.12.2 analyzer ratchet passed with no
baseline changes.
- Full `TZ=UTC bash app/test.sh --concurrency=4 --reporter expanded`:
**3,929 tests passed**, exit code 0, plus the 138-test protected spine.
- `make preflight`: all 24 selected checks passed. Draft-body preflight:
23 checks passed. Bounded pre-push gate passed; `df970edef3` is pushed.
- All three review findings were fixed, replied to and resolved.

## Failure class

Failure-Class: new

FC-offline-storage-mixed-palette records the mixed
palette/card-background failure introduced by #19378 and the executable
production-sheet contrast guard.

## Product invariants affected

none
kodjima33 added a commit that referenced this pull request Oct 8, 2026
…y the setup rating question (#20985)

## Summary
- Device (pendant) tutorial: the shared step scaffold, progress dots,
Continue button and the transcription / ask-a-question / power-cycle /
double-press steps hard-coded white or black from the old dark-only
design. On the default light palette (#19378) the last steps showed
white text and white cards on a white gradient. All of it now resolves
from `OmiColors` (works in light and dark).
- Onboarding setup rating alert copy: "Are you enjoying Omi?" with
**Yes** / **No** in all 49 locales (`scripts/l10n.py set`); the separate
"Rating us 5 stars…" line is removed (`scripts/l10n.py remove`).

## Verification
- `flutter test test/widgets/device_onboarding_step_contrast_test.dart
test/widgets/onboarding_setup_page_test.dart
test/widgets/onboarding_intro_skip_test.dart
test/widgets/device_onboarding_voice_reply_step_test.dart` → 17 passed.
The new contrast test fails on the old scaffold in both palettes.
- `flutter analyze` on changed files: no issues. `python3
scripts/l10n.py check`: ok, 49 locales.
- iOS simulator (iPhone 16 Pro, light + dark): built the dev flavor with
a local-only (uncommitted) harness that opens the tutorial and steps
through all six screens, then the setup page with the rating alert;
screenshots below.

## Screenshots
![Tutorial step 1, light
mode](.agent-artifacts/ui-evidence/20985/001-mobile-ios-speak-into-omi-light.png)
![Tutorial step 2, light
mode](.agent-artifacts/ui-evidence/20985/002-mobile-ios-ask-a-question-light.png)
![Tutorial step 4 (Turn Off), light
mode](.agent-artifacts/ui-evidence/20985/003-mobile-ios-turn-off-light.png)
![Tutorial step 5 (Customize Double Tap), light
mode](.agent-artifacts/ui-evidence/20985/004-mobile-ios-double-tap-light.png)
![Tutorial last step (All Set), light
mode](.agent-artifacts/ui-evidence/20985/005-mobile-ios-all-set-light.png)
![Tutorial step 4 (Turn Off), dark
mode](.agent-artifacts/ui-evidence/20985/006-mobile-ios-turn-off-dark.png)
![Tutorial step 5 (Customize Double Tap), dark
mode](.agent-artifacts/ui-evidence/20985/007-mobile-ios-double-tap-dark.png)
![Setup rating prompt: Are you enjoying Omi? Yes /
No](.agent-artifacts/ui-evidence/20985/008-mobile-ios-rating-prompt-light.png)

## Product invariants affected
none

## Failure class
Failure-Class: new
sauranshbhardwaj pushed a commit to sauranshbhardwaj/omi that referenced this pull request Oct 8, 2026
…y the setup rating question

The pendant tutorial's shared step scaffold, progress dots, Continue button and the
transcription, ask-a-question, power-cycle and double-press steps hard-coded white or
black from the dark-only design. Since the app defaults to the light palette (BasedHardware#19378),
step titles and cards rendered white on the white surface gradient. They now resolve
from OmiColors (textPrimary/textSecondary/surface1/accent/onAccent), so both
appearances work.

The onboarding setup rating alert now asks "Are you enjoying Omi?" with Yes / No
(all 49 locales via scripts/l10n.py; the separate 5-star body line is removed).

Verification: flutter test device_onboarding_step_contrast_test (fails on the old
scaffold in both palettes, passes now), onboarding_setup_page_test,
onboarding_intro_skip_test, device_onboarding_voice_reply_step_test: 17 passed;
flutter analyze on changed files clean; scripts/l10n.py check ok (49 locales).

Failure-Class: new
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