Fix admin general settings form: dot-free field names, flat PATCH keys (#322) #326

Merged
fable-5 merged 2 commits from 322-admin-settings-form-flat-keys into main 2026-08-04 12:43:53 +02:00
Collaborator

Closes #322.

The general + quota cards registered react-hook-form fields under the DOTTED settings keys; RHF nests on input, the strict PATCH schema rejects the body, and the form looks fine while never saving -- on every instance. Found by Stefan on a fresh self-hosted install (dt.leisinger.info), confirmed on dorfteich.online.

  • New admin-settings-form.ts: dot-free form model, one explicit field->setting mapping, converters both ways; submit carries only the settings these cards edit.
  • Saving now also invalidates the branding query (TopBar shows the new instance name immediately).
  • New e2e pack admin-settings.spec.ts (registered in ci.yml with its own rate-limit reset): renames THROUGH the form, asserts success message, TopBar update, reload persistence, api value. Locally verified to FAIL against the unfixed page and pass against the fix.
  • Unit test pins: no form field name contains a dot; mapping round-trips.

Local evidence: new pack green against the dev stack; negative check red against origin/main's page; web unit suite 141 green; typecheck + lint green; api full suite against fresh DB 597 green (one documented ECONNRESET load flake, green isolated).

🤖 Generated with Claude Code

https://claude.ai/code/session_017aviRTgWCcAHUh1SBoxf6P

Closes #322. The general + quota cards registered react-hook-form fields under the DOTTED settings keys; RHF nests on input, the strict PATCH schema rejects the body, and the form looks fine while never saving -- on every instance. Found by Stefan on a fresh self-hosted install (dt.leisinger.info), confirmed on dorfteich.online. - New admin-settings-form.ts: dot-free form model, one explicit field->setting mapping, converters both ways; submit carries only the settings these cards edit. - Saving now also invalidates the branding query (TopBar shows the new instance name immediately). - New e2e pack admin-settings.spec.ts (registered in ci.yml with its own rate-limit reset): renames THROUGH the form, asserts success message, TopBar update, reload persistence, api value. Locally verified to FAIL against the unfixed page and pass against the fix. - Unit test pins: no form field name contains a dot; mapping round-trips. Local evidence: new pack green against the dev stack; negative check red against origin/main's page; web unit suite 141 green; typecheck + lint green; api full suite against fresh DB 597 green (one documented ECONNRESET load flake, green isolated). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017aviRTgWCcAHUh1SBoxf6P
fable-5 added 1 commit 2026-08-04 11:18:44 +02:00
Fix admin general settings form: dot-free field names, flat PATCH keys (#322)
Some checks failed
CI / Lint, typecheck, test (pull_request) Successful in 6m42s
CI / Build container images (pull_request) Successful in 1m20s
CI / Auth e2e pack (pull_request) Failing after 10m3s
CI / Import/export fidelity gate (pull_request) Has been skipped
9f754649d4
The general and quota cards registered their react-hook-form fields under
the dotted settings keys. RHF treats dots as nested-path separators, so
the form DISPLAYED fine (its getter falls back to the literal flat key)
but typing nested the value ({ instance: { name } }) and the api's strict
PATCH schema rejected the body — none of these fields ever saved through
the UI, on any instance. Found by Stefan on a fresh self-hosted install.

- admin-settings-form.ts: dot-free form model with one explicit mapping
  to the dotted settings keys and converters in both directions; the
  submit now also carries ONLY the settings these cards edit, so the
  internal branding metadata keys never ride along.
- Saving invalidates the branding query too — the TopBar reads the
  instance name from it and kept the old name until its staleTime ran out.
- admin-settings.spec.ts (new e2e pack, registered in ci.yml): drives the
  rename THROUGH THE FORM — success message, TopBar update without
  reload, value survives reload, api returns it. Verified locally to fail
  against the unfixed page and pass against the fix. Every existing
  admin-settings test patched the api directly, which is why this bug was
  invisible to CI.
- admin-settings-form.test.ts pins that no form field name contains a dot
  and the mapping round-trips.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017aviRTgWCcAHUh1SBoxf6P
fable-5 added 1 commit 2026-08-04 11:42:57 +02:00
Follow the field rename in vs-nfd-marking locators
Some checks failed
CI / Lint, typecheck, test (pull_request) Successful in 7m0s
CI / Build container images (pull_request) Successful in 1m23s
CI / Auth e2e pack (pull_request) Successful in 9m0s
CI / Import/export fidelity gate (pull_request) Successful in 1m1s
CD / Deploy to Test (push) Blocked by required conditions
CD / Smoke tests against Test (push) Blocked by required conditions
CD / Promote to Int (push) Blocked by required conditions
CI / Auth e2e pack (push) Blocked by required conditions
CI / Import/export fidelity gate (push) Blocked by required conditions
CI / Build container images (push) Blocked by required conditions
CI / Lint, typecheck, test (push) Has been cancelled
CD / Build and push images (push) Has been cancelled
4d6a27194f
The pack addresses the registration-mode select by its DOM name
attribute, which react-hook-form derives from the field name — now
`registrationMode` (dot-free, see admin-settings-form.ts). Caught by CI
run 713; the pack needs VS_NFD_MODE stages and was not part of the local
verification set.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017aviRTgWCcAHUh1SBoxf6P
fable-5 merged commit 4d6a27194f into main 2026-08-04 12:43:53 +02:00
Sign in to join this conversation.
No description provided.