Repository navigation
Add an optional new design, switched on from Settings - #18
Merged
Merged
Conversation
The classic design stays the default. The new design, called Slate in the code, is turned on per device under Settings, Appearance, New design. Slate has its own shell, overview and settings. Chores, Money, Calendar and Driveway keep their page logic and dialogs and swap only their layout. All of its styles are scoped to :root[data-design="slate"], so classic is unchanged while it is off. Also adds a shared appearance module for the design and per-design theme, a read-only insights layer for the new charts and the needs-you list, and tests for both.
Keep classic exactly as it was: - Load the slate stylesheet, shell and layouts only once the design is on, and stop precaching its font. - Resolve the classic theme the way master did when storage is blocked or holds an unexpected value, and never override what the document shows. - Re-render on a theme change only where the theme is used. Fix what the new design got wrong: - A bill stays due for the whole of its due day. - Buttons keep their size and weight; index.css was flattening them. - The overview shows the recovery-email prompt again. - Claims past their deadline no longer ask for a photo or a vote. - Balance rows read as table rows, dialogs and menus take and return focus, and menus move with the arrow keys. - Light theme colours and placeholders meet 4.5:1, and touch targets grow on phones. Switching design now loads the other design first, so it lands on a finished page instead of a loading screen.
- Switching design no longer flashes the loading screen: the parts of each design are preloadable, and render at once after they have been loaded. - Confirm the slate stylesheet really arrived before showing slate. It marks the root element, and a missing mark means classic for this visit at startup, or a clear message from Settings. The stylesheet has one loader, so a second request can never be mistaken for a finished one. - Move focus into any dialog opened inside slate and back to where it was when the dialog closes. - A bill that carries an old paid mark is done, as in classic. - Hint text on gauge fills, and the danger hover, meet 4.5:1. - Test the production build's cold start, since the dev server loads styles differently.
- The dialog focus handling now also notes what was pressed, since Safari does not focus a button on click. A press on something that cannot take focus clears the target, so focus never returns to an older element. - A dialog asking a question cannot be closed by any route while its request is running. - Everything waiting on the slate stylesheet shares one load, and a slate cold start falls back to classic if its shell cannot be loaded. - Categories not picked on the money page fade their fill, not their text.
- A press that turns into a scroll is not remembered as what opened a dialog. - Fading the categories that are not picked animates again.
The demo house keeps Toronto time while its sample data is dated from the device's clock. On CI, which runs in UTC, the sample chore for today fell on the household's tomorrow for the last hours of the Toronto day, so the two tests about what today shows failed there.
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.
Summary
Adds a second design for the app. It is off by default: the current design stays what everyone sees. Turn the new one on under Settings → Appearance → New design, and off again with the same switch. The choice is saved per device, like the theme.
What the new design changes
The current design is unchanged
How it is built
src/lib/appearance.tsowns the design and theme preference.index.htmlapplies it before first paint.src/slate/holds the new shell, overview, settings, the four page layouts, charts and styles. Chores, Money, Calendar and Driveway keep their page logic and dialogs and swap only their layout.src/lib/insights.tsis a read-only layer that derives what the charts and the "Needs you" list show.:root[data-design="slate"].@fontsource-variable/instrument-sans, self-hosted and only loaded with the new design.Testing
household.spec.tson mobile Chrome. It also fails onmasterthere.