Repository navigation
Tell the two households apart on the Dashboard - #40
Merged
Merged
Conversation
The Dashboard is the one screen that aggregates across households, and it dropped the attribution while doing it: the stat cards silently summed every household, and "Products by location" listed everyone's locations in one flat list. With two households, a "Freezer" in each was indistinguishable (#33). The per-household accent + icon already existed (HouseholdTheme, user-choosable, persisted server-side) and the stats already carried a householdId — the Dashboard just never used either. So group the chart into a card per household, headed by its avatar and name, and badge the running-low and favourite rows. Name and icon carry the meaning; colour reinforces it, so the screen still reads without colour vision. Two things worth calling out: - The bar scale stays global rather than per-card. Scaled per card, a household whose best location holds 2 products would draw a full bar next to another's full bar holding 9, and the chart would misrepresent the comparison it exists to show. - The accents are pastels tuned for dark navy, and a solid bar needs >= 3:1 against its track (WCAG 1.4.11) — amber on the light track is ~1.5:1. So bars get a darkened light-theme palette, mirroring what Frost already does for its own accent (FrostAccent -> FrostLightPrimary). The palette is plain ARGB in a Compose-free file so the contrast is unit-tested, since unit tests here have no Compose on the classpath. All of it is gated on having more than one household: a single-household user sees the Dashboard exactly as before, with no headers, badges or caption.
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.
Closes #33.
What the tester saw
The Dashboard is the one screen that aggregates across households, and it dropped the attribution while doing it. The stat cards silently summed both households, and "Products by location" listed everyone's locations in one flat list — so
Freezer DownstairsandBijkeukengave no clue which household they lived in.The issue asks for "two different colours". Colour tells two rows apart; it doesn't tell you which household a row belongs to — for that the household has to be named. So this groups and names first, and uses colour to reinforce.
What's here
The per-household accent + icon already existed (
HouseholdTheme— 8 each, user-choosable, persisted server-side), andLocationStats/LowStockItem/ShelfEntryalready carried ahouseholdId. The Dashboard just never used either, so no API, DTO or repository change was needed.households.size > 1.Two decisions worth review
The bar scale stays global, not per-card. Scaled per card, a household whose best location holds 2 products would draw a full-width bar next to another household's full-width bar holding 9 — the chart would misrepresent the comparison it exists to show. Pinned by a test.
Bars needed a light-theme palette. The accents are pastels tuned for dark navy; a solid bar is a graphical object needing ≥3:1 against its track (WCAG 1.4.11), and amber
#FCD34Don the light track#DCECF6is ~1.5:1. Bars now use a darkened tone per hue, mirroring what Frost already does for its own accent (FrostAccent #7DD3FC→FrostLightPrimary #2298BA). The avatar wash keeps the pastel — at 28% alpha under anonSurfaceicon it was never the contrast-carrier.Unit tests have no Compose on the classpath (which is why
HouseholdThemeIndexis Compose-free), so the palette is stored as plain ARGB longs inHouseholdPalette.ktand the contrast is actually unit-tested —HouseholdPaletteTestcomputes WCAG luminance and fails any hue that can't clear 3:1 on its track. That caught the Tailwind-600 amber/green/orange, which I had to darken further.Verification
font_scale=1.0,font_weight_adjustment=null.Design doc:
docs/superpowers/specs/2026-07-12-dashboard-household-differentiation-design.md