Commit Graph
22 Commits
Author SHA1 Message Date
bchanot 7f1d44065b feat(app): editor store, undo, recovery copy and geometry accept rules 2026-11-04 12:13:10 +01:00
bchanot 4111efa1d1 fix(app): unreadable permissions show a retry, never the form (V1-2.5 L1)
Owner checkpoint 2026-11-02: creation page checks loading, server refusal, failed read, then the editor rule; Administration home shows the same notice. reloadAccess re-reads roles and grants without wiping held state; refreshAccount (no caller) removed. Zone panel live region always mounted. Unit and e2e for reviewer-only and editor.
2026-11-02 21:21:59 +01:00
bchanot 5db85ff19f fix(app): a failed account reload clears the own grant rows
Delta verifier note: the catch kept earlier catalogGrants beside status failed, against the field's doc; now emptied, test extended.
2026-11-02 19:49:19 +01:00
bchanot e39f69ee6d fix(app): a failed account load no longer leaves own grants loading
Delta verifier: when the profile or roles read failed, the grant read never ran and the creation page waited forever; the catch now marks the grants failed (form shown, server decides). Store transition tests (ready, loading on change and sign-out, failed), red without the fix. Contract clarification states the failed-read behaviour for the owner.
2026-11-02 18:41:32 +01:00
bchanot f04bfdd040 fix(app): creation page waits for own grants; e2e never prints setup keys
Delta verifier: two remaining setup-key assertions now booleans. Its observation: the editor rule read grants before they loaded; authStore.catalogGrantsStatus (loading, ready, failed): the page waits, and a failed read leaves the decision to the server. App 654, e2e:ui 227, admin shell spec 14 + 6 skipped.
2026-11-02 18:33:57 +01:00
bchanot 4744e28986 feat(app): admin and catalogue entries, step-up guard, MFA in Mon compte (V1-2.5 E, F)
Nav hint from own grants and roles (never a control); RequireCatalog, RequireAdmin (no admin read before aal2), Accès non autorisé page, placeholder routes; TOTP factor list, enrolment with QR and one-time secret, removal, inline step-up for aal2 actions, step-up in password reset; auth kind aal2_required. App 601, e2e:ui 227.
2026-11-02 16:49:37 +01:00
bchanot e1c1980949 fix(app): a re-read of the same account keeps its workspace on screen
USER_UPDATED (or a retry) set the workspace back to loading, which unmounted
the client routes and lost an open form's typed values. A ready workspace now
stays until the answer; found by the V1-1.5 security audit.
2026-10-26 02:08:25 +01:00
bchanot b38e62770e feat(app): clients list, page, create, edit, archive and restore
Routes /app/clients, /new, /:clientId, /:clientId/edit behind a workspace
gate that remounts per workspace; debounced POST search, archived toggle and
« Afficher plus » pages; form on field-limits (D-R7) with the phone entry
rule and ISO countries; request id per creation intent; conflict shows the
saved values; archive confirmation with the sole-owner preview; animals
read-only; leave guard on in-app links; Clients entry after the dashboard.
2026-10-26 01:59:25 +01:00
bchanot ff028ec071 feat(app): personal workspace in the account store, reset on account change
The store reads the personal workspace with the account (ready, loading,
inactive, unconfirmed, missing, error; never created in the browser). A
change of account drops profile, roles, avatar and workspace at once, and a
late answer for the previous account is ignored. generateUuid gives v4 ids on
the plain-HTTP LAN origin, where crypto.randomUUID is missing.
2026-10-26 01:59:25 +01:00
bchanot 9bd9acaf58 fix(app): rescue copy importable, trapping draft held, replace confirmed
The JSON rescue copy could not be restored in the app, a draft that traps
the engine left the tab on a reload screen and spent a recovery on every
read, and an unsaved or in-progress report could be lost by a reload
outside the editor or by New report / Import without warning.

Home import reads the copy (content-sniffed, 16 MiB cap, strict UTF-8)
through the core's draft.restore before any session change; a trapping
(draft, archive) pair is held in the resolution panel and only re-read
on Retry; ReplaceSessionDialog guards New report and Import; the
beforeunload guard is app-wide while unsaved. Supersedes BDR-055's
"never held" for `internal` only.
2026-10-17 12:58:57 +02:00
bchanot 6371523f8c fix(editor): honest stopped state when the draft is unsaved; no dead retry
0279953 chose the stopped message from CoreRuntime.stopped alone: it
promised the report was kept even when the tab's storage refused the
draft (export, the banner's advice, needs the core), four surfaces still
offered a retry that could not work, and a failed recovery below the cap
was a dead end since nothing called retry().

The runtime restarts a failed recovery on the next call (compiled module
reused, cap still counts traps) and notifies status listeners. One
CoreStoppedNotice on the editor, Home, New report and the full-page
notice: reload when saved, else core.stopped_unsaved with a core-free
copy download (also on the storage-full banner) and a beforeunload
guard. Export, import and new report say the stopped message; a core
failure reading an unread draft is FAILED, not held. ESLint census of
the failure keys; core.stopped says "plusieurs erreurs".
2026-10-16 18:26:10 +02:00
bchanot c97b0e7c67 fix(store): banner on a refused archive write, rescue download kept alive 2026-10-14 23:18:33 +02:00
bchanot a37c50b9ee fix(store): drop the replaced archive when the new one cannot be written 2026-10-14 23:15:54 +02:00
bchanot e34b7f282e fix(store): hold session texts whose set-aside fails, never overwrite them 2026-10-14 23:11:59 +02:00
bchanot da8a0370cb fix(app): set lone-surrogate texts aside or refuse them with a message (L1)
A draft the core refuses as lone_surrogate is unreadable content: it
goes to osteo:quarantine:draft verbatim with the existing notice. An
import is refused as ImportError('lone_surrogate') with the owner's
wording (home.import.error_lone_surrogate, FR/EN), the file untouched.
The publish gate reads the kind as invalid_shape. Tests on the real
core: quarantine keeps the exact text, an editor action leaves the
report as it was, normal text with pairs and literal backslashes reads
unchanged.
2026-10-14 21:49:39 +02:00
bchanot 74fcb37564 feat(app): R2 switch — the application runs its domain rules in the Rust core
Consumers now fed by the core (crates/core through @faunosteo/core-wasm):
- the sheet: the bundled payload is parsed and indexed by the core
  (SheetHandle, SheetIndexData); SheetIndex reads precomputed tables only;
- the store: new report, add / remove / move observation, draft restore
  (v2 migration + rebase) through the core, actions answering { ok };
- the editor click chain (zone.click), laterality and vertebra pickers
  (zone.add_sides, vertebra.initial / sync / select), the findings picker
  (finding.toggle by clicked leaf position), zone removal;
- the import: engine byte scan (TypeScript until R4), then the core's
  layered reading and rebase in one call; the export: the core builds the
  sheet snapshot, the frozen TypeScript engine writes the PDF (R4).
Lazy core: Home and the new-report form read the sheet availability from
the bundle and load the module on import / submit only; the auth shell
never references it. Degraded states (core_unavailable, invalid_sheet)
show the validated notice with a retry and never redirect or touch the
draft; an unreadable draft or archive is set aside under
osteo:quarantine:* (only content kinds; a failed write keeps it in place
and the editor stays), a rebase that flags items keeps the raw pre-rebase
draft. Four strings, wording validated by the owner.
Deleted: services/zoneInteraction.ts and its suite (13 cases ported to
cargo), the TypeScript Finding builder and vertebra selection rules of the
pickers, store rules, persistence parsing, hydrateReport. ESLint forbids
@faunosteo/domain in apps/app/src; the report:compare CLI keeps the frozen
domain until R4 (scripts/compare/sheet.ts). App suite 313/313 on the real
core (24 new tests: quarantine, degraded editor, core failures, N-1
reader); step6 goldens and the frozen envelopes unchanged.
2026-10-14 00:41:34 +02:00
bchanot 926dd7df8c feat(app): profile photo — avatar upload in Mon compte, photo in the sidebar, drawer and top bar
packages/supabase assets module: closed AssetFailure kinds, begin / quarantine
upload (upsert off) / confirm / remove, own-row state read with an explicit
column list, download under the SELECT policy. App: client transport (magic
byte sniff, never SVG, createImageBitmap, canvas 1024 px, JPEG 0.9, 5 MiB
cap), AvatarSection (preview, save, 1 s polling up to 30 s, rejection and
failure messages per closed code, removal with confirmation, in-flight row
resumed at mount), auth store blob URL revoked on change and sign-out,
AvatarCircle in UserBadge and the top bar link to Mon compte (D3), FR/EN
strings, fake client extended, 27 new tests (app 300).
2026-10-13 19:32:37 +02:00
bchanot 9771d997f4 fix(app): failed sign-out reported (local session still cleared); reauthentication_needed phrased; docs(docs): exact production redirect allowlist 2026-10-11 23:45:14 +02:00
bchanot c517ea267b feat(app): identity screens and /app shell — auth store, login/signup/reset flows, dashboard, account
- state/authStore: session subscription (initialize + onAuthStateChange), profile + roles load, recovery flag, URL failure; services/localeSync: profiles.locale <-> localeStore
- routes: /login, /signup, /forgot-password, /reset-password, /auth/callback; guards RequireAuth (next=) and RedirectIfSignedIn; /app (dashboard), /app/account behind the guard
- shell: AppLayout (desktop sidebar, light top bar, mobile drawer), SidebarNav, UserBadge, SignOutButton
- account: personal / professional / preferences / security sections, one save each, Zod validation with i18n keys
- ui: Icon, FormField, Notice, ButtonLink (buttonClassName shared), PasswordField, OAuthButtons (config-driven)
- Home header: Mon espace / Se connecter when Supabase is configured; local tool routes untouched
- i18n: auth.*, shell.*, dashboard.*, account.*, home.space.* in fr + en
2026-10-11 23:29:13 +02:00
bchanot 9bd5173a9c feat(app): export and import through @faunosteo/pdf — snapshot, archived branding and labels, browser rasterizer, imported archive kept in session, explicit rebase with messages; legacy PDF modules removed 2026-10-11 13:32:14 +02:00
bchanot ce2ec26112 feat(app): application on the canonical sheet — report v3 store with v2 draft migration, bundled SheetProvider (SHEET_BUNDLE), annotation layer rendered from the document, zone interaction service, pickers and cards on the sheet index, PDF v3 export with v2 archive import; legacy registry, matchers, editors and assets removed 2026-10-10 11:36:14 +02:00
bchanot 8673475293 chore(workspace): move the app to apps/app under a pnpm workspace (step 2)
144 files moved with git mv (pure renames). Root package.json delegates
dev/typecheck/test:run/lint/build to the packages; Node 24 LTS and
pnpm 10.13.1 pinned (.nvmrc, .node-version, engines, packageManager,
root devDependency, engine-strict). Dockerfile builds @faunosteo/app on
node:24-alpine and copies apps/app/dist; nginx and runtime config
unchanged. CI workflow for Gitea Actions. packages/ reserved (README only).
Docs synced: WORKSPACE.md, CLAUDE.md, README, DEPLOY, CHANGELOG, plan.
271/271 tests, typecheck, lint, build green from the root.
2026-10-08 21:51:13 +02:00