Skip to content

feat(dashboard): one row of tiles, the rest under "All values" - #1577

Merged
MBombeck merged 7 commits into
release/v1.50.0from
feat/dashboard-one-row
Nov 26, 2026
Merged

MBombeck merged 7 commits into
release/v1.50.0from
feat/dashboard-one-row

Conversation

@MBombeck

@MBombeck MBombeck commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

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 by CSS. The strip is a size container; the tile at index i hides while fewer than i + 1 columns fit the 11 rem track (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.
  • Order. Pinned tiles first, then tiles with something to say today (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.attention and tiles.order on GET /api/dashboard/snapshot (withTileOrder, no extra query). The web reads tiles.order; saving the layout refetches the snapshot.
  • "All values" opens the rest in place in the same grid. A button with aria-expanded rather than the shared Disclosure: 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.
  • Blood pressure is one tile, systolic over diastolic, both means and both 7-day trends ("−3/−1"); the means take the colour of the side further from its band, and the hint names both bands. Still links to the blood pressure page.
  • Pins survive older clients. A PUT whose widgets arrive without pinned keeps the stored pin per widget id (every shipped app build saves its layout without the field); an explicit false unpins. Unit and integration tests, both failing before the fix. pinned does not exist on main, so nothing to fix there.
  • Pins. Settings > Customize dashboard gets a pin column (widgets[].pinned, stored only when true). The rows wrap their controls below lg so the name keeps its line.
  • Tile anatomy and charts unchanged.

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 duplicated aria-label on a generic span.

Checks: typecheck, lint, unit, next build, axe on the strip, the toggle and the settings rows (light and dark, no violations), e2e dashboard-one-row.spec.ts (new), dashboard.spec.ts and seven related specs on desktop and mobile.

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.
…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
@MBombeck
MBombeck merged commit ce6b821 into release/v1.50.0 Nov 26, 2026
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant