Skip to content

Tell the two households apart on the Dashboard - #40

Merged
spdotdev merged 3 commits into
mainfrom
feat/dashboard-household-differentiation
Jul 12, 2026
Merged

spdotdev merged 3 commits into
mainfrom
feat/dashboard-household-differentiation

Conversation

@spdotdev

@spdotdev spdotdev commented Jul 12, 2026 •

Copy link
Copy Markdown
Owner

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 Downstairs and Bijkeuken gave 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), and LocationStats / LowStockItem / ShelfEntry already carried a householdId. The Dashboard just never used either, so no API, DTO or repository change was needed.

  • Products by location — one card per household, headed by its avatar + name, bars tinted with its accent.
  • Running low / favourites — a leading household badge, carrying the household name as its content description (the avatar was silent to TalkBack before, and on these rows it's the only thing saying which household you're looking at).
  • Stat cards — numbers unchanged, but an "across 2 households" caption so the sum stops being a silent one.
  • Single-household users see no change at all — the whole thing is gated on 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 #FCD34D on the light track #DCECF6 is ~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 an onSurface icon it was never the contrast-carrier.

Unit tests have no Compose on the classpath (which is why HouseholdThemeIndex is Compose-free), so the palette is stored as plain ARGB longs in HouseholdPalette.kt and the contrast is actually unit-tested — HouseholdPaletteTest computes 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

  • Unit: 133/133 pass (6 new ViewModel, 4 new palette/contrast).
  • Instrumented: 44/44 pass on an emulator, including 2 new flow tests (two households head their own locations; a single household stays unlabelled). Device at font_scale=1.0, font_weight_adjustment=null.
  • ktlint + detekt clean.
  • Rendered and eyeballed on-device:

Two-household dashboard

Design doc: docs/superpowers/specs/2026-07-12-dashboard-household-differentiation-design.md

spdotdev added 3 commits July 12, 2026 22:25
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.
@spdotdev spdotdev self-assigned this Jul 12, 2026
@spdotdev spdotdev added the enhancement New feature or request label Jul 12, 2026
@spdotdev
spdotdev merged commit f14c21e into main Jul 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feedback] Two households - two different colours on Dashboard to differentiate?

1 participant