chore(app): drawer honours prefers-reduced-motion; chore(memory): BDR-041, LRN-047, journal, TODO 7.x
This commit is contained in:
1 parent
552733b4c8
commit
aeea1f2e9b
5 files changed
+31
-14
No files matched your search
@@ -343,3 +343,9 @@ Status: closed (Step 6 validated by user 2026-10-11; D8 finalised in BDR-040).
|
||||
User decisions after manual validation (logos and picker text confirmed OK on their side; Step 6 VALIDATED). (1) Re-export of the imported archive from the UI REFUSED permanently: the practitioner already holds the original PDF; no second button, no dedicated UX flow. Keep the archived snapshot, its integrity and the autonomy tests (engine `exportFromEnvelope` stays as the proof + future server use); the UI exports only the open working report. Do not propose this feature again. (2) Rebase on draft restore shown to the user (`editor.draft_rebased`) approved; import messages approved on principle with an explicit "full restoration" vs "partial recovery" headline. (3) BLK-009 treated now: byte-scan attachment extraction without pdf-lib load on import + export without object streams; remaining risks (worker/server import, pdf-lib replacement, read caps) stay an explicit BLOCKER gate before any external user import; never declared solved by passing tests alone.
|
||||
Alt rejected: a re-export action on the home screen after import (same objection); a toast system for import feedback (no component, alert pattern kept).
|
||||
Status: closed.
|
||||
|
||||
## BDR-041 | 2026-10-11 | Step 7 scope: zustand auth store (no TanStack), professional fields on profiles, MFA = documented gap, config-driven OAuth buttons, local tool stays open
|
||||
|
||||
Step 7 brief (UX validated by user with external mockups, not versioned). Choices: (1) no TanStack Query: one profile read/update per section, zustand `authStore` + `localeSync` enough; query layer deferred to the first list screens. (2) `practice_name`, `professional_title`, `siret` added to `profiles` as declared free text (CHECKs, column grants), verification stays the Professional Verification domain (Step 11). (3) MFA: foundations had TOTP disabled, no `has_mfa()`, no admin table → TOTP enabled server-side, enforcement + enrolment UI documented as gap (IDENTITY.md §4), Security section shows a note, no fake UI. (4) OAuth buttons listed by `APP_AUTH_PROVIDERS` / `VITE_AUTH_PROVIDERS`; config.toml providers read `env()` ids, `enabled = false` until ids exist; `platform_invitations` not written. (5) Local tool routes untouched + unauthenticated (`LocalToolShell`, catch-all), Home header entry only when Supabase configured; `/app` guard sends to `/login?next=` with same-origin check. (6) Account locale wins over device locale once per sign-in; switches while signed in persist to `profiles.locale`.
|
||||
Alt rejected: TanStack now (YAGNI); MFA enrolment screen (unvalidated UI, nothing to protect); `/register` naming (`/signup` kept); nested `<a><button>` for card CTAs (ButtonLink instead).
|
||||
Status: active, awaiting user validation of the step.
|
||||
@@ -211,3 +211,7 @@ User: step not merged; findings-picker text still blurry; footer logos absent in
|
||||
## 2026-10-11 (Step 6 closure)
|
||||
|
||||
User round 2: logos OK, picker text crisp, flows OK → STEP 6 VALIDATED. Decisions BDR-040: re-export-archive button refused for good; restore-rebase alert approved; import headlines full/partial (62b8a43). BLK-009: byte-scan attachment reader + export without object streams (60ee712), verifier CONFORME, audit PASS+2 MEDIUM → slice-fed inflater + candidate budget (3a6e926), focused re-audit. EVAL-014. Then: gitflow finish into develop, release/0.2.0 prep (Milestone A) up to the human go; Step 7 not started (UX/design to discuss with ChatGPT first).
|
||||
|
||||
## 2026-10-11 (Step 7 implementation)
|
||||
|
||||
User: mockups validated (external, not in repo), implement Step 7 on a branch. feature/step-07-identity-app-shell off develop (release/0.2.0 still open, awaiting go). Foundation: packages/supabase auth/profile/roles services (closed AuthFailure kinds), migration 20261011100000 professional columns + pgTAP 009 (PGlite 22/22, real stack 280/280, types regenerated), config.toml TOTP on + google/apple via env(), `APP_AUTH_PROVIDERS`. App: authStore + localeSync + AuthProvider, routes /login /signup /forgot-password /reset-password /auth/callback, guards, AppLayout (sidebar / top bar / drawer), dashboard (profile completeness, local tool, account), Mon compte (4 sections, one save each), Home entry when configured. Tests 277 app + 24 supabase, lint 0, typecheck, build, docker OK; impeccable detect clean; headless e2e against the local stack 20/20 (guard, login, account save, SIRET error, language, mobile no overflow, drawer, logout, signup → Mailpit confirmation → /app, recovery → reset → login). Docs: IDENTITY.md, CLAUDE.md, SUPABASE.md, CHANGELOG, plan note. BDR-041, LRN-047. Gates (verifier, security) dispatched; awaiting user validation; `.env.example` edit denied (file rule) → user adds `APP_AUTH_PROVIDERS=`.
|
||||
@@ -352,3 +352,8 @@ Apply: any `motion.*`/CSS transition on lists, cards, modals holding text; desig
|
||||
|
||||
Step 6 moved the PDF pipeline into `packages/pdf` with zero visible change. What made it provable: Phase 0 froze drawn text (page, x, y, size, font), image placements, link annotations and per-view structural facts with the OLD code, in two harness modes (logos absent / present via a fetch stub serving the real public/ bytes) and per locale (footer geometry depends on label width). Golden JSON = oracle; the port had 0 mismatch; the two intentional differences (hidden markers absent, data-* gone) were declared as relaxed fields, never by editing goldens. Snapshot shaped as a valid lean `AnatomicalSheetDocument` reused the index, the renderer and 21 integrity rules (3 challengers killed the dedicated-schema idea). Node-side xmldom composer already existed in curation (`app-review.ts`): promote, don't rewrite. resvg 0.40 panics on gradient fills culled by a cropped root viewBox (head view) → test adapter renders the full box and crops pixels; Chrome is fine. Executors denied `rm`/`git rm`: orchestrator deletes on literal relative paths after checking importers.
|
||||
Apply: any pipeline extraction (Step 13 Supabase provider, Step 14 worker); any "snapshot" design: reuse the live schema minus content before inventing one.
|
||||
|
||||
## LRN-047 | 2026-10-11 | Supabase Auth in a SPA: initialize() + PKCE same-browser rule, GoTrue codes → closed kinds, pgTAP data-modifying CTE trap
|
||||
|
||||
Step 7 facts worth keeping. (1) `client.auth.initialize()` is public and idempotent: await it at store start to catch the URL exchange error (expired/foreign link) that `onAuthStateChange` never reports; `INITIAL_SESSION` ordering vs that promise is not guaranteed → a callback route landing signed-out = failure, don't wait for a flag. (2) PKCE confirmation/recovery links only open a session in the browser that made the request (verifier in its localStorage); the email is still confirmed server-side → phrase it ("opened in another browser… just sign in"), don't claim expiry. (3) supabase-js 2.117 `AuthError.code` (`invalid_credentials`, `user_already_exists`, `weak_password`, `otp_expired`, `bad_code_verifier`…) → map to a closed union in the access layer, UI translates `auth.failure.<kind>`; raw messages never rendered. (4) Account load must run outside the auth callback (`setTimeout 0`): the client serialises callbacks, awaiting a request inside deadlocks. (5) pgTAP: `select is((with upd as (update … returning 1) select count(*) from upd), …)` fails ("data-modifying CTE must be top level") and silently breaks the plan count; use `lives_ok` + a read after `reset role`. (6) Mailpit API (`/api/v1/search?query=to:<email>`, `/api/v1/message/<id>`) makes the confirmation + recovery flows scriptable headlessly; playwright-core installed in the scratchpad + cached `ms-playwright` chromium via `executablePath` = no project dependency.
|
||||
Apply: every future Supabase auth surface (Step 14 gating, invitations), any pgTAP write assertion, any e2e of email flows.
|
||||
+10
-10
@@ -115,16 +115,16 @@ feat/findings-tree-v2 merged (FindingsTreePicker tracked in HEAD); all work belo
|
||||
- [ ] 5 follow-up: allowlist SVG sanitiser before Storage-served assets (Step 13); orphan findings UX (D5) at the report UX step; report:compare residuals (ZodError reason genericised, v3 lines computed once, long template lines); 16 MiB attachment cap without direct test
|
||||
|
||||
- [ ] Step 7 — identity: auth, profile, roles, /app shell (started 2026-10-11, branch feature/step-07-identity-app-shell; direction graphique validée par l'utilisateur: identité actuelle conservée, maquettes = référence externe non versionnée). Scope decisions: professional fields = additive migration on profiles (practice_name, professional_title, siret free text, verification = later domain); MFA = documented gap (TOTP disabled in config, no has_mfa helper, no admin table); no TanStack Query (zustand store suffices); legacy routes untouched and unauthenticated; /app visible from Home only when Supabase is configured
|
||||
- [ ] 7.0 plan + branch + ctx7 cache (supabase-js auth, config.toml providers)
|
||||
- [ ] 7.1 config: appConfig.authProviders (APP_AUTH_PROVIDERS / VITE_AUTH_PROVIDERS, google|apple), entrypoint + env.example + DEPLOY table; config.toml: TOTP enroll/verify on, [auth.external.google|apple] via env(), redirect URLs; packages/supabase: auth service wrappers (typed errors), profile read/update service
|
||||
- [ ] 7.2 migration 20261011100000_profiles_professional: practice_name, professional_title, siret (+ CHECKs, column grants); pgTAP 009; database.types regenerated (real stack) + schema-types map
|
||||
- [ ] 7.3 app state: authStore (status loading|signed_out|signed_in, session, user, profile, roles), bootstrap on getSession + onAuthStateChange, profile fetch, roles fetch; locale sync (profile.locale → localeStore on sign-in, localeStore → profiles.locale while signed in); AuthProvider in App
|
||||
- [ ] 7.4 auth screens: /login (email+password, OAuth buttons per authProviders, links), /signup (display name, email, password ×2, policy hints, "check your inbox" state), /forgot-password, /reset-password (PASSWORD_RECOVERY → new password), /auth/callback (code exchange → /app); AuthLayout (brand, cream card); not-configured state
|
||||
- [ ] 7.5 /app shell: RequireAuth guard (redirect /login?next=), AppLayout (desktop sidebar: dashboard, account, local tool link, logout; mobile top bar + drawer), /app dashboard (welcome, profile completeness card, local tool card, no fake stats)
|
||||
- [ ] 7.6 /app/account: personal (display, first, last, phone), professional (title, practice, siret), preferences (locale, timezone), security (change password, logout, MFA gap note), roles badge read-only
|
||||
- [ ] 7.7 Home coexistence: "Mon espace / Se connecter" entry on the header when configured; characterisation tests T12 unchanged with default config
|
||||
- [ ] 7.8 tests: config, authStore (fake client), locale sync, forms (validation, errors, submit), guard redirect, layout nav, account save; i18n parity; pgTAP; root check + docker build
|
||||
- [ ] 7.9 docs: SUPABASE.md auth section (providers env, Mailpit, MFA gap), CLAUDE.md map/architecture, CHANGELOG, plan note; memory (BDR, LRN, EVAL, journal); verifier + security gates; stop for user validation
|
||||
- [x] 7.0 plan + branch + ctx7 cache (supabase-js auth, config.toml providers)
|
||||
- [x] 7.1 config: appConfig.authProviders (APP_AUTH_PROVIDERS / VITE_AUTH_PROVIDERS, google|apple), entrypoint + env.example + DEPLOY table; config.toml: TOTP enroll/verify on, [auth.external.google|apple] via env(), redirect URLs; packages/supabase: auth service wrappers (typed errors), profile read/update service
|
||||
- [x] 7.2 migration 20261011100000_profiles_professional: practice_name, professional_title, siret (+ CHECKs, column grants); pgTAP 009; database.types regenerated (real stack) + schema-types map
|
||||
- [x] 7.3 app state: authStore (status loading|signed_out|signed_in, session, user, profile, roles), bootstrap on getSession + onAuthStateChange, profile fetch, roles fetch; locale sync (profile.locale → localeStore on sign-in, localeStore → profiles.locale while signed in); AuthProvider in App
|
||||
- [x] 7.4 auth screens: /login (email+password, OAuth buttons per authProviders, links), /signup (display name, email, password ×2, policy hints, "check your inbox" state), /forgot-password, /reset-password (PASSWORD_RECOVERY → new password), /auth/callback (code exchange → /app); AuthLayout (brand, cream card); not-configured state
|
||||
- [x] 7.5 /app shell: RequireAuth guard (redirect /login?next=), AppLayout (desktop sidebar: dashboard, account, local tool link, logout; mobile top bar + drawer), /app dashboard (welcome, profile completeness card, local tool card, no fake stats)
|
||||
- [x] 7.6 /app/account: personal (display, first, last, phone), professional (title, practice, siret), preferences (locale, timezone), security (change password, logout, MFA gap note), roles badge read-only
|
||||
- [x] 7.7 Home coexistence: "Mon espace / Se connecter" entry on the header when configured; characterisation tests T12 unchanged with default config
|
||||
- [x] 7.8 tests: config, authStore (fake client), locale sync, forms, guards, shell, dashboard, account; i18n parity; pgTAP 009 (PGlite + real stack 280/280); root check + docker build green; headless e2e vs local stack 20/20 (signup via Mailpit, recovery, logout, mobile)
|
||||
- [ ] 7.9 docs: IDENTITY.md (routes, session, providers, MFA gap, manual validation), SUPABASE.md, CLAUDE.md, CHANGELOG, plan note DONE; memory BDR-041, LRN-047, journal DONE; verifier + security gates dispatched; EVAL after gates; STOP for user validation (user action: `.env.example` += `APP_AUTH_PROVIDERS=`, file edit denied)
|
||||
---
|
||||
|
||||
## Phase A — DONE (kept for reference)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useEffect } from 'react'
|
||||
import { Link } from 'react-router-dom'
|
||||
import { AnimatePresence, motion } from 'motion/react'
|
||||
import { AnimatePresence, motion, useReducedMotion } from 'motion/react'
|
||||
import Brand from '@/components/brand/Brand'
|
||||
import Icon from '@/components/ui/Icon'
|
||||
import SidebarNav from './SidebarNav'
|
||||
@@ -16,6 +16,8 @@ export interface MobileDrawerProps {
|
||||
/** Left-side navigation drawer for small screens (transform + opacity only). */
|
||||
export default function MobileDrawer({ open, onClose }: MobileDrawerProps) {
|
||||
const t = useT()
|
||||
const reduced = useReducedMotion()
|
||||
const slide = reduced ? { x: 0 } : { x: '-100%' }
|
||||
useEffect(() => {
|
||||
if (!open) return
|
||||
const onKey = (e: KeyboardEvent) => e.key === 'Escape' && onClose()
|
||||
@@ -40,10 +42,10 @@ export default function MobileDrawer({ open, onClose }: MobileDrawerProps) {
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-label={t('shell.nav_label')}
|
||||
initial={{ x: '-100%' }}
|
||||
initial={slide}
|
||||
animate={{ x: 0 }}
|
||||
exit={{ x: '-100%' }}
|
||||
transition={{ duration: 0.2, ease: 'easeOut' }}
|
||||
exit={slide}
|
||||
transition={{ duration: reduced ? 0 : 0.2, ease: 'easeOut' }}
|
||||
className="absolute inset-y-0 left-0 flex w-[min(20rem,85vw)] flex-col bg-[var(--color-surface)] shadow-xl pt-[env(safe-area-inset-top)] pb-[env(safe-area-inset-bottom)]"
|
||||
>
|
||||
<div className="flex items-center justify-between px-4 py-3 border-b border-[var(--color-border)]">
|
||||
|
||||
Reference in new issue
Block a user