Repository navigation
feat(menu): add an appearance choice that follows the system by default - #217
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
brandyscarney
force-pushed
the
feat/dark-mode-preference
branch
from
December 3, 2026 22:13
828c649 to
d875474
Compare
The menu's Dark Mode toggle is replaced with an Appearance section with System, Light and Dark choices. System is the default and follows the system dark mode setting, including changes while the app is open. The choice is saved in Preferences and used on the next load. Co-authored-by: Bruce LANE <138158+brucelane@users.noreply.github.com>
brandyscarney
force-pushed
the
feat/dark-mode-preference
branch
from
December 3, 2026 22:44
d875474 to
1ca9805
Compare
Member
Author
|
@thetaPC I made some changes to this if you want to take another look. This does remove our only toggle example in this app but I have added a follow-up to create a Settings page which will hold this appearance setting as well as a toggle for something like timezone. The other conference app PRs are also needing review. |
This branch was successfully deployed
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.
The menu's Dark Mode toggle only switched the palette for the current visit: the app started in light mode on every load and ignored the system dark mode setting. The toggle is replaced with an Appearance section in the menu:
prefers-color-scheme: dark), including changes while the app is open.appearanceand used on the next load.The choices are radios with an icon each, like the other menu items. They use the iOS radio on both platforms, so the picked choice is marked with a checkmark instead of a radio circle. The rows are slightly shorter than the other menu items to keep the section compact.
The user state holds only the saved
appearance. A newuseSystemDarkModehook reads the system setting withuseSyncExternalStore, andAppapplies the dark palette to<html>in a layout effect. The palette is set before the schedule data loads, so a dark system no longer shows a light screen first.setAppearancesaves before returning its action, likesetHasSeenTutorial.Unit tests cover loading the saved choice, a saved value that is not a choice falling back to System, saving the choice, and the hook following system changes and removing its listener. The unit test for the old toggle is removed. e2e tests check that the choices switch the palette, that System follows the system setting, that the choice is kept after a reload, and that the app is dark before the schedule loads when the system prefers dark mode.
Same change in the other conference apps: ionic-team/ionic-conference-app#1932, ionic-team/ionic-vue-conference-app#128
Based on #77 by @brucelane, who is credited as co-author.