Repository navigation
fix(app): Settings and sheets follow a Light/Dark switch while open - #19844
Conversation
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.
|
@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? |
|
Thanks @Itaxh1 — clean diagnosis and a well-scoped fix. Per-file notes:
Also verified against 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 |
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.showpassedbackgroundColor: OmiColors.surface0toshowModalBottomSheet, andshowOmiSheetpassed
OmiColors.surface1.ModalBottomSheetRoutestores that colour when the sheet opens. Its page does rebuildon a theme change, but it re-reads only the stored value, while everything inside the sheet reads the new palette.
OmiSheetRoute(new): aModalBottomSheetRoutewhosebackgroundColoris a getter over asurfacecallback, so the page reads the active palette on every theme rebuildui/components/omi_sheet.dartshowOmiSurfaceSheet(new): the Omi shell (24pt top corners, framework drag handle, safe area) on that route, pushed the same wayshowModalBottomSheetpushes its routeui/components/omi_sheet.dartshowOmiSheetnow uses it onsurface1; the API and look are unchangedui/components/omi_sheet.dartsurface0, replacing its rawshowModalBottomSheetand theomi-ux-allow: raw-bottom-sheetexceptionpages/settings/settings_drawer.dartEvery
showOmiSheetcaller gets the fix too. The only other rawshowModalBottomSheetcalls(
ui/components/omi_edit_sheet.dartandcore/app_shell.dart) are untouched: they use a transparent sheet andpaint their own surface inside it.
Screenshots
Before, from #19843: after switching to Light (left) and to Dark (right). The email line is blurred.
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.
Product invariants affected
none
How it was verified
test/widgets/settings/settings_sheet_appearance_test.dart(new) builds the app root the waymain.dartdoes(palette from
AppearanceProvider,theme/darkTheme/themeMode, one navigator key, the subtree re-keyed bybrightness). It opens the real Settings sheet and switches Dark → Light → Dark. On
mainit fails with thescreenshot's colours: the sheet stays
#000000where Light'ssurface0is#F2F2F7, and ashowOmiSheetstayswhite in Dark. Both cases pass with this change.
test/spine/b1_settings_surface_test.dartand the semantics baseline: 74 passed.bash app/test.sh: 3,563 passed, 5 skipped, 0 failed.bash app/scripts/analyze_ratchet.sh: passed.make preflightagainstmain(pr_preflight.py --lane local --base upstream/main): 22 checks passed.scripts/pr-preflight --pr-body-filewith this description: passed.flutter build ios --config-only --profile --flavor prod, thenxcodebuild) and installed. Switching Light and Dark from Appearance and going back nowrepaints 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:surface0across Dark → Light → Dark and stays openshowOmiSheetrepaintssurface1across Light → DarkFailure class (fixes)
Failure-Class: none