Skip to content

fix(app): Settings and sheets follow a Light/Dark switch while open - #19844

Merged
Git-on-my-level merged 1 commit into
BasedHardware:mainfrom
Itaxh1:fix/settings-sheet-appearance
Sep 30, 2026
Merged

Git-on-my-level merged 1 commit into
BasedHardware:mainfrom
Itaxh1:fix/settings-sheet-appearance

Conversation

@Itaxh1

@Itaxh1 Itaxh1 commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

What changed and why

Closes #19843. After switching Light/Dark under Settings → Notifications & Display → Appearance and swiping back,
the Settings sheet kept the previous theme's background while its rows and header were drawn in the new one. In
Light it stayed black behind white rows, and in Dark it stayed light grey behind dark rows. The header (search,
"Settings", close X) was invisible in both.

SettingsDrawer.show passed backgroundColor: OmiColors.surface0 to showModalBottomSheet, and showOmiSheet
passed OmiColors.surface1. ModalBottomSheetRoute stores that colour when the sheet opens. Its page does rebuild
on a theme change, but it re-reads only the stored value, while everything inside the sheet reads the new palette.

Change Where
OmiSheetRoute (new): a ModalBottomSheetRoute whose backgroundColor is a getter over a surface callback, so the page reads the active palette on every theme rebuild ui/components/omi_sheet.dart
showOmiSurfaceSheet (new): the Omi shell (24pt top corners, framework drag handle, safe area) on that route, pushed the same way showModalBottomSheet pushes its route ui/components/omi_sheet.dart
showOmiSheet now uses it on surface1; the API and look are unchanged ui/components/omi_sheet.dart
Settings uses it on surface0, replacing its raw showModalBottomSheet and the omi-ux-allow: raw-bottom-sheet exception pages/settings/settings_drawer.dart

Every showOmiSheet caller gets the fix too. The only other raw showModalBottomSheet calls
(ui/components/omi_edit_sheet.dart and core/app_shell.dart) are untouched: they use a transparent sheet and
paint their own surface inside it.

Screenshots

Before, from #19843: after switching to Light (left) and to Dark (right). The email line is blurred.

Before: Settings sheet after switching to Light, black sheet behind white rows Before: Settings sheet after switching to Dark, light sheet behind dark rows

After, with this change, on the same iPhone: Settings → Notifications & Display → Appearance → Light (left) and Dark (right), then back to the sheet. The email line is blurred.

After: Settings sheet in Light, light grey sheet behind white rows, header visible After: Settings sheet in Dark, black sheet behind dark rows, header visible

Product invariants affected

none

How it was verified

  • test/widgets/settings/settings_sheet_appearance_test.dart (new) builds the app root the way main.dart does
    (palette from AppearanceProvider, theme/darkTheme/themeMode, one navigator key, the subtree re-keyed by
    brightness). It opens the real Settings sheet and switches Dark → Light → Dark. On main it fails with the
    screenshot's colours: the sheet stays #000000 where Light's surface0 is #F2F2F7, and a showOmiSheet stays
    white in Dark. Both cases pass with this change.
  • Settings, every sheet test, test/spine/b1_settings_surface_test.dart and the semantics baseline: 74 passed.
  • bash app/test.sh: 3,563 passed, 5 skipped, 0 failed.
  • bash app/scripts/analyze_ratchet.sh: passed.
  • make preflight against main (pr_preflight.py --lane local --base upstream/main): 22 checks passed.
  • scripts/pr-preflight --pr-body-file with this description: passed.
  • Built from this branch for an iPhone 15 Pro Max on iOS 26.6.2 (flutter build ios --config-only --profile --flavor prod, then xcodebuild) and installed. Switching Light and Dark from Appearance and going back now
    repaints the whole sheet (screenshots above). It was signed under a personal preview bundle id and App Group, a
    build-only change that is not in this PR.

Tests

  • test/widgets/settings/settings_sheet_appearance_test.dart:
    • the open Settings sheet repaints surface0 across Dark → Light → Dark and stays open
    • an open showOmiSheet repaints surface1 across Light → Dark

Failure class (fixes)

Failure-Class: none

Review in cubic

showModalBottomSheet fixes a sheet's background when the sheet opens. After
switching the appearance on a page opened from Settings and going back, the
Settings sheet kept the old surface under rows and a header drawn in the new
palette: black behind white rows in Light, light behind dark rows in Dark,
with the header text invisible in both.

OmiSheetRoute reads its surface each time the theme rebuilds the sheet.
showOmiSheet uses it on surface1, and Settings uses it on surface0 in place
of its raw showModalBottomSheet.
@Itaxh1

Itaxh1 commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator Author

@Git-on-my-level small one on the Settings sheet from #19730: after switching Light/Dark and going back, the sheet kept the old theme's background (header invisible). Screenshots and a regression test are in the description. Could you take a look?

@Git-on-my-level

Copy link
Copy Markdown
Member

Thanks @Itaxh1 — clean diagnosis and a well-scoped fix.

Per-file notes:

  • app/lib/ui/components/omi_sheet.dart — OmiSheetRoute overriding backgroundColor as a getter over the surface() callback is the right mechanism: ModalBottomSheetRoute stores the colour at construction, while the sheet's Material re-reads route.backgroundColor on every theme rebuild, so an open sheet now follows the active palette. showOmiSurfaceSheet mirrors the framework's route construction faithfully (capturedThemes, scrimLabel/scrimOnTapHint, modalBarrierColor from bottomSheetTheme), and showOmiSheet's public API is unchanged.
  • app/lib/pages/settings/settings_drawer.dart — moving Settings onto showOmiSurfaceSheet with surface0 keeps the same shell (drag handle, safe area, 24pt corners, 0.92 height factor) and retires the omi-ux-allow: raw-bottom-sheet exception rather than re-anchoring it — good.
  • app/test/widgets/settings/settings_sheet_appearance_test.dart — the test root mirrors main.dart's wiring (palette from AppearanceProvider, light/dark buildOmiTheme, themeMode, one navigator key, subtree re-keyed by brightness), which is exactly the mechanism the bug rides on. Both the surface0 Settings case and the surface1 showOmiSheet case are covered across mode switches, and the "sheet stays open" assertion pins the regression.
  • app/changelog/unreleased/20260929-settings-sheet-appearance.json — matches the existing unreleased-changelog convention.

Also verified against main: the two remaining raw showModalBottomSheet call sites (omi_edit_sheet.dart, app_shell.dart shared-tasks sheet) are transparent-background sheets that paint their own surface, so leaving them untouched is correct.

One note for the maintainer pass: the Dart Analyze & Tests and Android compile suites are skipped on this PR (fork CI gating), so the reported local run (3,563 passed) isn't independently confirmed by CI yet — worth a quick maintainer glance before merge.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added positive-signal Automation verified a genuine fix/quality contribution flutter flutter work labels Sep 29, 2026
@Git-on-my-level
Git-on-my-level merged commit 0aa841c into BasedHardware:main Sep 30, 2026
46 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flutter flutter work positive-signal Automation verified a genuine fix/quality contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Settings sheet keeps the old theme after switching Light/Dark (header invisible)

2 participants