Skip to content

Every dashboard tile opens its chart; body fat gets its page - #1087

Merged
MBombeck merged 3 commits into
mainfrom
fix/dashboard-tile-links
Oct 2, 2026
Merged

MBombeck merged 3 commits into
mainfrom
fix/dashboard-tile-links

Conversation

@MBombeck

@MBombeck MBombeck commented Oct 2, 2026

Copy link
Copy Markdown
Owner

Refs #1084.

The body fat tile opened nothing. The tile→page links were a hand-kept list in src/app/page-client.tsx, and body fat was left out on purpose because it never got a sub-page when every other measurement type did (v1.7.0); a test even pinned that state.

  • New /insights/body-fat built on the same HealthKitMetricPage as fat mass, bone mass and the other body-composition pages (Body group tab, seven locales, empty state with the manual-entry action). OpenAPI regenerated: body-fat is a new insights layout id.
  • Tile destinations live in src/components/dashboard/tile-destinations.ts, keyed by widget id; a missing destination or one that is not a real route is a type error. Links go through isSurfaceVisible("insights-page:<slug>"), so a tile never points to a page a switched-off module hides.
  • Guard tile-destinations.test.ts reads tiles from TILE_CAPABLE_WIDGET_IDS and from the rendering code (both must agree, with floors), and fails when a tile's measurement type has a page it does not open, a destination is not a route, a link crosses into another module, or the dashboard bypasses the table. Removing the body fat link (and the page) turns it red.

All other 18 tiles were already linked. Not changed: the chart cards lower on the dashboard do not link anywhere.

MBombeck and others added 2 commits October 2, 2026 21:21
The body fat tile was the one strip tile that led nowhere. Its href map
said there was no dedicated sub-page, which was true: body fat percentage
was tiled and charted on the dashboard but never got the Insights page
every body-composition sibling has.

Add /insights/body-fat on the generic metric-page scaffold (body group,
tab-strip pill, seven locales, manual-entry empty state) and link the
tile to it.

Move the tile href map out of the page into tile-destinations.ts, keyed by
the tile-capable widget id and typed against the sub-page slug union, so
a missing or non-existent destination fails to compile. The link passes
the destination's insights-page surface gate, so it never points at a
page a switched-off module hides.

A guard derives the tile set from TILE_CAPABLE_WIDGET_IDS and from the
ids the dashboard actually pushes into its strip, and fails when a tile's
metric has a sub-page the tile does not open, when a destination has no
route, or when a tile links to a page owned by another module. Tiles that
deliberately lead nowhere need a written reason; there are none today.

The reverse-lookup test pinned BODY_FAT as having no page; it now
resolves to body-fat.

Refs #1084
@MBombeck
MBombeck merged commit e6e5bd0 into main Oct 2, 2026
25 checks passed
@MBombeck
MBombeck deleted the fix/dashboard-tile-links branch October 2, 2026 21:50
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