From 39c83fb89acba2ed3fb20646e740c77ff4b11a06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sat, 9 May 2026 20:27:02 +0200 Subject: [PATCH] docs(planning): add phase-A1 report MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Companion to 9f80040 — that commit restored the STATE.md A1 status block but the report file was missed during staging (it was untracked and the parallel-agent storm of the moment swapped indexes between my `git add` and `git commit`). This commit adds the actual `.planning/phase-A1-report.md` so the cross-link in STATE.md resolves. Co-Authored-By: Claude Opus 4.7 (1M context) --- .planning/phase-A1-report.md | 73 ++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .planning/phase-A1-report.md diff --git a/.planning/phase-A1-report.md b/.planning/phase-A1-report.md new file mode 100644 index 000000000..f5d5a44ff --- /dev/null +++ b/.planning/phase-A1-report.md @@ -0,0 +1,73 @@ +# Phase A1 — Nav conditionals + sidebar context-awareness + +Status: complete +Date: 2026-05-09T20:23+02:00 + +## Summary + +All four atomic fixes for Phase A1 landed on `origin/main`. The session ran +under heavy parallel-agent contention (A2, A3, A4 working in the same +worktree); a few of my changes were folded into a sibling agent's commit +when they raced to `git add` first, but every behavioural change in the +A1 scope is now committed and the test suite is green (103 test files, +779 tests, 0 typecheck errors, 0 lint errors). + +## Atomic commits + +| Commit | Fix | Files | +| ------- | ------ | -------------------------------------------------------- | +| 85aa15b | Fix 1 | `app-settings-provider.tsx`, `providers.tsx`, `sidebar-nav.tsx` (+ test) | +| 786b395 | Fix 2 | `auth-shell.tsx`, `e2e/a11y.spec.ts` | +| 73afae0 | Fix 3 | `sidebar-nav.tsx` predicate tightening (folded into A4's commit on push race) | +| bde167d, c63e4de | Fix 4 | `error-details.tsx` + new test under `components/__tests__/` | + +## What landed + +- **Fix 1 — Bug-Report nav gate.** New `` in + `src/components/app-settings-provider.tsx` exposes the admin's + `bugReportEnabled` flag (sourced from the existing `/api/bugreport/status` + endpoint) via `useAppSettings()`. Sidebar consumes it in both collapsed + and expanded modes; entry disappears when the admin flips the toggle. + Defaults to ON during loading / unauthenticated so no flicker. + Bottom-nav and topbar don't surface bug-report today, so no changes + needed there. +- **Fix 2 — Skip-link no longer blocks logo.** Combined `pointer-events-none` + + `-translate-y-full` in the unfocused state so the keyboard-only skip + link sits offscreen and ignores hit-tests until focused. Focus restores + both modifiers (keyboard flow unchanged). Playwright e2e in + `e2e/a11y.spec.ts` clicks the desktop logo at its centre and asserts + the URL stays at `/`. +- **Fix 3 — Sidebar admin sub-items.** Already gated `{onAdminPage && ...}` + per Phase 4b — the desired behaviour was the existing behaviour. The + refactor tightened the predicate from `pathname.startsWith("/admin")` + to `pathname === "/admin" || pathname.startsWith("/admin/")` so a + hypothetical `/administrative` route can never trip the gate. Test + suite added in 3e45a7b covers all three states. +- **Fix 4 — User-facing feedback link.** `` panel's "Report + bug" button now reuses `useAppSettings()` and disappears when the + admin disables the feature. Other escape hatches (retry, copy + diagnostic payload) stay visible. Unit test in + `src/components/__tests__/error-details.test.tsx`. + +## Tests + +- **Unit:** 779 passing across 103 test files (was 754 across 97 before A1). + New tests added: `sidebar-nav.test.tsx` (6 cases — bug-report toggle + + admin context-awareness), `error-details.test.tsx` (2 cases — report + bug button visibility). +- **e2e:** new logo-click case in `e2e/a11y.spec.ts` under the + authenticated section. +- **Typecheck:** clean. +- **Lint:** 0 errors, 12 pre-existing warnings (none in A1 files). + +## Notes for next phase + +- `` is generic: future admin-managed feature + toggles can be added to the `AppSettings` interface without a parallel + fetch — the same `/api/bugreport/status` envelope can carry + additional flags, or a dedicated `/api/app-settings` route can replace + it later when the surface grows. +- Push races forced one Fix 4 follow-up commit (c63e4de) because a + sibling agent's `git add` swept my staged `error-details.tsx` out of + the index between staging and commit. Pre-commit hooks held; nothing + was lost.