diff --git a/.planning/STATE.md b/.planning/STATE.md index 14a60deb1..86c19e716 100644 --- a/.planning/STATE.md +++ b/.planning/STATE.md @@ -17,12 +17,34 @@ Last update: 2026-05-09T20:06:00+02:00 ### A1 — Nav conditionals + sidebar context-awareness -- [ ] Bug-Report-Toggle hides Sidebar nav (also bottom-nav, topbar) -- [ ] Skip-link does NOT block logo click on desktop -- [ ] Sidebar admin sub-items only expand when on `/admin/*` route (view-context-aware) -- [ ] Feedback section visible only when admin enabled feedback toggle +- [x] Bug-Report-Toggle hides Sidebar nav (also bottom-nav, topbar) +- [x] Skip-link does NOT block logo click on desktop +- [x] Sidebar admin sub-items only expand when on `/admin/*` route (view-context-aware) +- [x] Feedback section visible only when admin enabled feedback toggle - Detailed report: `.planning/phase-A1-report.md` +#### Status — 2026-05-09T20:23+02:00 — Phase A1 complete + +All four fixes landed on `origin/main`: + +- `85aa15b` fix(nav): hide bug-report entry in nav when admin disables the toggle +- `786b395` fix(a11y): skip-link no longer blocks logo click outside focus +- `73afae0` refactor(nav): admin sub-items predicate tightened to `pathname === "/admin" || startsWith("/admin/")` (folded into A4's medication-compliance commit on push race; the sidebar-nav.tsx hunk inside that commit is mine) +- `bde167d` + `c63e4de` fix(feedback): hide ErrorDetails report-bug button when admin disables the feature (impl + test split because a sibling agent's `git add` raced mine; both halves on main) + +New shared primitive: `src/components/app-settings-provider.tsx` exposes +`useAppSettings()` to any client component. Today it carries +`bugReportEnabled`; future admin feature flags should join the same +context to avoid parallel fetches. + +Tests: 779/779 unit pass (was 754/754 before A1). Typecheck clean, +lint clean (12 pre-existing warnings, none in A1 files). One new +Playwright e2e case (`a11y.spec.ts` — logo click reachable through the +skip-link area). + +Marc-status: speed mattered, hit by parallel-agent worktree contention +mid-session but all behavioural changes shipped. + ### A2 — /admin overview redesign + /admin/api-tokens responsive - [ ] `/admin` overview replaces section-grid with audit-log preview + system-status snapshot @@ -31,11 +53,35 @@ Last update: 2026-05-09T20:06:00+02:00 ### A3 — Quick-add labels + Stimmung-Card mobile + onboarding flicker -- [ ] Quick-Add submenu disambiguation (no double "Hinzufügen") -- [ ] Stimmung-Card mobile: large number + label only (no doubled number/label) -- [ ] Onboarding flicker: don't render until status loaded; don't auto-open when complete +- [x] Quick-Add submenu disambiguation (no double "Hinzufügen") — `3e45a7b` +- [x] Stimmung-Card mobile: large number + label only (no doubled number/label) — `2c227fb` +- [x] Onboarding flicker: don't render until status loaded; don't auto-open when complete — `bb4dc12` - Detailed report: `.planning/phase-A3-report.md` +A3 status @ 2026-05-09T20:25:00+02:00 — done. + +DE labels switched from nouns ("Messung" / "Stimmungseintrag") to +verb-phrases ("Messung erfassen" / "Stimmung erfassen"); EN matched +("Log measurement" / "Log mood"). Unit guard at +`src/app/__tests__/quick-add-labels.test.ts` locks distinctness from +each other AND from `common.add` (the trigger). Mood-list mobile branch +no longer prints the score digit twice — title line is now just the +localized label, badge keeps the digit. Onboarding card refuses to +mount while `analyticsQuery.data === undefined`, eliminating the +~500 ms flash for established users; new users see a collapsed shell +with the progress meter visible (chevron toggle is `aria-expanded` + +`aria-controls`). Two new Playwright specs on the `chromium-mobile` +project: `e2e/mood-card-mobile.spec.ts` (one occurrence of score per +row) and `e2e/onboarding-flicker.spec.ts` (50ms sample-loop during a +deliberately-slowed analytics fetch + collapsed-by-default assertion). + +Tests: 779/779 unit pass, typecheck clean, lint clean (12 pre-existing +warnings, none in A3 files). 3 atomic commits, all pushed after +rebase-with-autostash; no force-pushes, no `--no-verify`. One race +landed `.planning/phase-A1-report.md` + `STATE.md` into A3's staging +area mid-commit; restored those to A1's ownership before committing +fix 3. + ### A4 — Dashboard analytics fixes - [ ] BD-Zielbereich 0% bug — calculation review diff --git a/.planning/phase-A3-report.md b/.planning/phase-A3-report.md new file mode 100644 index 000000000..f426cacce --- /dev/null +++ b/.planning/phase-A3-report.md @@ -0,0 +1,73 @@ +# Phase A3 — Quick-add labels + Stimmung-Card mobile + onboarding flicker + +Status: done · Commits: 3 (3e45a7b, 2c227fb, bb4dc12) · 2026-05-09 + +## Fix 1 — Quick-Add submenu disambiguation (3e45a7b) + +The dashboard "Add" dropdown rendered two items whose visible text both +read as bare nouns ("Messung" / "Stimmungseintrag" in DE; "Measurement" / +"Mood entry" in EN). With the trigger ALSO labelled "Add" / "Hinzufügen" +and the leading icon `aria-hidden`, screen-reader users heard the same +verb 3× with no signal which row did what. Updated both translations to +self-contained verb phrases: DE "Messung erfassen" / "Stimmung erfassen", +EN "Log measurement" / "Log mood". Added +`src/app/__tests__/quick-add-labels.test.ts` to lock the contract: +both labels must be non-empty, distinct from each other, and distinct +from `common.add` (the trigger). + +## Fix 2 — Mood-list mobile redundancy (2c227fb) + +`src/components/mood/mood-list.tsx` mobile branch (`md:hidden`) rendered +each entry's score TWICE: large bold digit in the left badge, then again +in the title line as `"{score} ({label})"`. Desktop's table only ever +showed it once. Collapsed the title line to just the localized label +(e.g. "Schlecht"); row now reads "[2] Schlecht / 12.05.2026 18:30 / tags". +Added `data-testid="mood-row"` + `data-testid="mood-row-score"` hooks +and a Pixel-5 Playwright spec at `e2e/mood-card-mobile.spec.ts` that +asserts each row contains its score digit exactly once via word-boundary +regex and that the badge still paints the digit. + +## Fix 3 — Onboarding flicker + collapsed-by-default (bb4dc12) + +Two bugs in one card. Flicker: the component rendered against +default-true `shouldShowChecklist({ measurementCount, ... })` while +analytics was in flight (`measurementCount = 0` until tanstack-query +wrote `data`). For a complete-onboarding user with 30 measurements the +card flashed ~500 ms before `stillInSetup` flipped to false. Fix: refuse +to render until `analyticsQuery.data !== undefined` — tanstack-query +writes `data` exactly once per fetch, race-free. + +Auto-open: introduced `expanded` state (default `false`, persisted to +`localStorage[healthlog-getting-started-expanded]`). Header is now a +chevron toggle (`aria-expanded`/`aria-controls`); the progress meter +stays visible in both states. Card mounts collapsed for new users. + +E2E spec at `e2e/onboarding-flicker.spec.ts` covers both: a 50ms-sample +loop during a deliberately-slowed analytics fetch proves the card never +paints for a complete-onboarding user, and a second test mounts an +incomplete user and asserts `aria-expanded=false` + that +`#getting-started-body` is NOT in the DOM until clicked. + +## Verification + +- `pnpm test`: 779 tests / 103 files / all green +- `pnpm typecheck`: clean (0 errors) +- `pnpm lint`: 12 pre-existing warnings, 0 errors +- 3 atomic commits pushed to `origin/main` after rebase-with-autostash; + no force-pushes, no `--no-verify`, signed via gpg + +## Overlap with other agents + +A4 added `MedicationComplianceChart` to `src/app/page.tsx` between fix 1 +and fix 3 — no collision, my edits to that file were isolated to the +quick-add-menu region. A2 staged `.planning/phase-A1-report.md` + +`.planning/STATE.md` into my staging area mid-commit; I unstaged them +before committing fix 3 so each agent owns their own report file. + +## Out of scope (for later phases) + +The mood-list mobile fix targets `/mood` (the page where Marc sees the +Stimmung-Card). If "Stimmung-Card mobile redundancy" was intended to +mean the dashboard's mood `TrendCard` instead, that tile already shows +a single number ("2") + unit ("/ 5") with no label text — no changes +needed there.