Repository navigation
feat(dashboard): one row of tiles, the rest under "All values" - #1577
Merged
Merged
Conversation
The tile strip showed every switched-on tile, which grew to two rows and more. It now shows as many tiles as fit one row at the current width, decided by container queries alone (no measuring in script, never a partial second row). Pinned tiles lead, then the tiles with something to say today (latest reading outside its target band, a clear week, a reading from today), then the rest in their saved order. Everything else opens in place under "All values", stored per account in the layout as `tilesExpanded`. Blood pressure is one tile, systolic over diastolic, with both means and both trends; the means take the colour of the side further from its band. The order is resolved on the server (`tiles.attention`, `tiles.order` on the snapshot) so the native app can follow the same rule; the layout gains `widgets[].pinned` and `tilesExpanded`, both additive and stored only when set. Settings > Customize dashboard gets a pin switch per tile. The tile-capable widget list moves to `lib/dashboard/tile-widgets.ts` so the settings list can read it without splitting the dashboard gates out of the page bundle. snapshot.ts grows by five lines (the two snapshot fields and their imports); its size baseline moves to 1487.
…oard-one-row # Conflicts: # CHANGELOG.md
…t send The one row now has two compact columns below two 11 rem tiles, never a single tile; three from about 600 px. Columns are max(2, floor((width + 12) / 188)) for the strip width, written into the tile-order description. A layout save from a client that predates `pinned` sends its widgets without the field, and the save replaced the whole array, so every shipped app build cleared the pins set on the web. A widget that arrives without `pinned` now keeps the stored pin; an explicit false unpins.
…oard-one-row # Conflicts: # CHANGELOG.md # src/__tests__/baselines/source-file-lines.json # src/__tests__/baselines/version-stamp-comments.json
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 start page tile strip showed every switched-on tile, which on a full account meant two rows and more. It now shows one row.
one-row.ts). Columns = max(2, floor((width + 12) / 188)) for the strip width in CSS px: two compact tiles side by side on a phone (never one alone), three from about 600 px, six at 1440. Never a partial second row, no measuring in script.range: latest reading outside its target band;change: a week with a fit of at least 0.7 adding up to 5 % of the monthly mean;today: a reading from the local today), then the rest by saved order. Resolved on the server:tiles.attentionandtiles.orderonGET /api/dashboard/snapshot(withTileOrder, no extra query). The web readstiles.order; saving the layout refetches the snapshot.aria-expandedrather than the sharedDisclosure: a<details>holds its content inside itself, and these tiles stay in the one grid beside the row's own. Open or closed is stored per account in the layout (tilesExpanded, preserve-when-absent, omitted at the default); a delegate keeps it for the visit only. The switch hides when every tile fits.pinnedkeeps the stored pin per widget id (every shipped app build saves its layout without the field); an explicitfalseunpins. Unit and integration tests, both failing before the fix.pinneddoes not exist onmain, so nothing to fix there.widgets[].pinned, stored only when true). The rows wrap their controls belowlgso the name keeps its line.Contract: additive only (
widgets[].pinned,tilesExpanded,tiles.attention,tiles.order); OpenAPI regenerated. No migration.Bundle: +0.7 KB gz unique client code measured locally against the branch base (1990.7 to 1991.4, both local builds). The tile-capable widget list moved to
lib/dashboard/tile-widgets.ts, because importing it from the dashboard gates into settings split the gates into their own module (+0.8 KB); TrendCard renders its two means through one helper; the comparison caption drops a duplicatedaria-labelon a generic span.Checks: typecheck, lint, unit,
next build, axe on the strip, the toggle and the settings rows (light and dark, no violations), e2edashboard-one-row.spec.ts(new),dashboard.spec.tsand seven related specs on desktop and mobile.