Feature 20: Cards auto-discover children from the household roster #174

Member

Task 1b6d91d2-7998-48e5-be06-2b4d726ee7b2 — Cards auto-discover children (Feature 20 - Zero-Config Panel Dashboard).

Done-condition: the party-board card renders correctly with no child_order configured, discovering children from a household entity attribute in sort order; a test renders the card against a snapshot with three children and asserts three plates appear in the configured order without any child_order key.

What

  • custom_components/nestquest/sensor.py: the household quests-due-today rollup now publishes a child_roster attribute alongside the unchanged per-child children counts — one ordered entry per active child in the coordinator snapshot's order (the API's sort_order, then id), each carrying child_id, name, and the slug HA's entity-id derivation produces for the child's name (accented-Latin faithful mirror of homeassistant.util.slugify, registry-style _2/_3 collision suffixes for duplicate display names, the 64-char entity-id cap, and HA's unknown sentinel; the unidecode divergence is documented).
  • frontend/src/cards/party-board.ts: when the config has no child_order key, _discoveredChildSlugs() reads the ordered slugs from that roster; a supplied child_order still wins verbatim (empty array included). No other plate rendering or style change.
  • Bundle rebuilt (cd frontend && npm run build) and the output committed — HACS does not build it.
  • Tests: two render tests drive frontend/tests/render-party-board.mjs (new, jsdom-based) against the committed bundle — three plates in sort order with no child_order key, plus explicit child_order override; a source-level test pins the discovery contract. Integration tests pin the roster shape/order, snapshot-order tracking on refresh, duplicate-name suffixing, the empty household, and the slugify mirror (cross-checked against real HA's slugify).

Checks

  • cd frontend && npm run build — clean (deterministic rebuild verified)
  • npx tsc --noEmit — clean
  • TZ=UTC uv run pytest -q — 1683 passed (baseline 1675 + 8 new)
  • TZ=UTC uv run pytest -q tests/test_panel_cards.py — 11 passed

The no-admin-controls guard and all existing panel tests are untouched and green.

Task 1b6d91d2-7998-48e5-be06-2b4d726ee7b2 — Cards auto-discover children (Feature 20 - Zero-Config Panel Dashboard). **Done-condition**: the party-board card renders correctly with no child_order configured, discovering children from a household entity attribute in sort order; a test renders the card against a snapshot with three children and asserts three plates appear in the configured order without any child_order key. ## What - `custom_components/nestquest/sensor.py`: the household quests-due-today rollup now publishes a `child_roster` attribute alongside the unchanged per-child `children` counts — one ordered entry per active child in the coordinator snapshot's order (the API's sort_order, then id), each carrying `child_id`, `name`, and the `slug` HA's entity-id derivation produces for the child's name (accented-Latin faithful mirror of `homeassistant.util.slugify`, registry-style `_2`/`_3` collision suffixes for duplicate display names, the 64-char entity-id cap, and HA's `unknown` sentinel; the unidecode divergence is documented). - `frontend/src/cards/party-board.ts`: when the config has no `child_order` key, `_discoveredChildSlugs()` reads the ordered slugs from that roster; a supplied `child_order` still wins verbatim (empty array included). No other plate rendering or style change. - Bundle rebuilt (`cd frontend && npm run build`) and the output committed — HACS does not build it. - Tests: two render tests drive `frontend/tests/render-party-board.mjs` (new, jsdom-based) against the committed bundle — three plates in sort order with no `child_order` key, plus explicit `child_order` override; a source-level test pins the discovery contract. Integration tests pin the roster shape/order, snapshot-order tracking on refresh, duplicate-name suffixing, the empty household, and the slugify mirror (cross-checked against real HA's slugify). ## Checks - `cd frontend && npm run build` — clean (deterministic rebuild verified) - `npx tsc --noEmit` — clean - `TZ=UTC uv run pytest -q` — **1683 passed** (baseline 1675 + 8 new) - `TZ=UTC uv run pytest -q tests/test_panel_cards.py` — 11 passed The no-admin-controls guard and all existing panel tests are untouched and green.
dev_agent added 1 commit 2026-09-23 09:35:55 -04:00
The board rendered nothing until a parent hand-wrote child_order with
each child's slug — the DAKOS bring-up gap. The household rollup now
publishes an ordered child_roster attribute (snapshot sort_order, each
entry carrying the slug the way HA derives entity ids, so the card can
build sensor.nestquest_<slug>_...), and the card discovers its plates
from it when the config carries no child_order; a supplied child_order
still wins. The rollups' existing per-child children counts attribute
is unchanged. Render tests drive the committed bundle under jsdom, so
the discovery contract is asserted on the artifact HACS ships.
review_agent left a comment
Member

Independent Claude Sonnet 5 review completed for this exact commit.

Independent Claude Sonnet 5 review completed for this exact commit.
dev_agent merged commit 316503cf73 into feature/3e640c07-2132-46e2-a363-be72ee091291-zero-config-panel-dashboard 2026-09-23 09:40:53 -04:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Maniacs_Mansion/NestQuest#174