Repository navigation
feat(widget): render the SahajCloud-authored report-issue form from sy-atlas-config - #219
Conversation
`pnpm types:cms`. SahajCloud#823 (its #813) added `reportIssueForm` to the `sy-atlas-config` global: the `contact` form the widget's report-issue path renders and posts against. Generated output only. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_014mb9orTUt9wn78RSzKQMZU
`sendReport` posted a `contact` row that named no form, and the collection refuses one: `form: This field is required.`, a `ValidationError` carrying no code, so every report reached the viewer as the generic failure. SahajCloud#823 settled the contract the other way — the atlas names an authored contact form on `sy-atlas-config.reportIssueForm`, and that form owns the questions and the recipient. So `getAtlasConfig` now selects the id at `depth: 0`, `getReportForm` reads the form behind `reportFormQuery`, and `sendReport` sends `form` plus the answers as pairs under the names the operator authored. Three guards keep `recipient` out of the browser, since it is a relationship to a manager and a populated read would publish a name and an address on every host page: the read is `depth: 0`, its `select` names neither `recipient` nor `client`, and `ReportFormSchema` carries neither. `lib/report-form.ts` holds the derivation — which blocks render, the validation each one implies, and the answers they produce. Authored names never reach react-hook-form: a name is operator-typed and RHF reads `.` and `[]` as a path, so fields register by position and `reportAnswers` re-attaches the name. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_014mb9orTUt9wn78RSzKQMZU
The form hard-coded an optional email, a message, and `ReportSchema`. It now renders the authored blocks of the form named on `sy-atlas-config` — text, textarea, email, select, checkbox, number, country, state and prose — with the validation each block implies and the operator's own submit label and confirmation copy. Where the operator left a field unlabelled, the widget falls back to its own copy for the two blocks it has words for, label and placeholder together: under a question they DID write, our hint would describe a different question. A block type this build cannot render is dropped rather than thrown on, and the modal host degrades to a failure panel when the form cannot be read at all. This path is reached BECAUSE something already failed, so it must not be the second thing to fail — which is also why the host reads the form for the widget's whole life rather than on open. Authored prose renders as TEXT, not HTML: the serializer's HTML form needs the DOMPurify pass that goes with it, and this form sits in the eager graph. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_014mb9orTUt9wn78RSzKQMZU
The CMS field says an empty value hides report-issue entirely, and a `contact` row naming no form is refused anyway — so an affordance offered without one leads to a send that cannot succeed. The settings row and the error fallbacks' report button now both gate on the config. The fallbacks read the cache imperatively, the way `currentLocales` does, for a sharper reason: `FallbackActions` renders where the app is already broken, with no query provider guaranteed above it, so a hook there would throw inside the error fallback. An unreadable config answers "no" for the same reason a missing id does. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_014mb9orTUt9wn78RSzKQMZU
`data-layer.md` described `sendReport` as naming no form, and carried SahajCloud#813 as an open blocker. Both are settled: the row names the authored form, and the `forms` read must never select `recipient` or `client`. The CHANGELOG entry is for the hosts: the questions, the submit label and the confirmation message are managed in SahajCloud now, and where no form is named the widget shows no report affordance at all. No new parameter, no new origin. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_014mb9orTUt9wn78RSzKQMZU
Four findings from the branch review, each a real one: The report gate moves out of `FallbackActions` and into `visibleActions`' new `canReport` limit — the function that already arbitrates policy against surface, and whose last-resort rule (restore the report CTA when narrowing deleted every other way out) my renderer-level `&&` was silently voiding. With the gate there, the imperative cache read goes too: every production render of `FallbackActions` is inside the query provider, so the hook subscribes and the button appears when the config lands, instead of staying hidden for the life of a screen that mounted first. `ReportFormSchema` is pinned to the generated CMS types. This matters more here than in the usual case: `renderableFields` DROPS a block it cannot parse, so a renamed member would turn an operator's question into a field that silently stops rendering, with every gate green. `AuthoredField` picks its control with a `switch` over the union, so a block type added to the schema cannot render a labelled field with nothing inside it, and is memoized — the form validates on every keystroke, and each one re-walked every prose block's Lexical tree. The schema, the resolver and the defaults are memoized for the same reason. The rest is wording: one bound per zod chain instead of one per arm, a copy table with an optional `help`, and the error sentence behind its own guard. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_014mb9orTUt9wn78RSzKQMZU
The embedding guide pointed hosts at a form that may not exist, and the fallback rules described a restore-the-report-CTA guarantee that `canReport` can now withhold. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_014mb9orTUt9wn78RSzKQMZU
Deploying sahajatlas-design with
|
| Latest commit: |
1fa06bd
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b5bc9afa.sahajatlas-design.pages.dev |
| Branch Preview URL: | https://claude-feat-216-report-form.sahajatlas-design.pages.dev |
Deploying sahajatlas with
|
| Latest commit: |
1fa06bd
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://8666d35c.sahajatlas.pages.dev |
| Branch Preview URL: | https://claude-feat-216-report-form.sahajatlas.pages.dev |
|
🤖 no session running recent dispatchesWritten by the sydevs dispatcher. Sessions never edit this comment. |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
The diff matches the ticket step for step, and nothing is smuggled in. recipient and client are absent from the select and manager-locked on the CMS side, and every report affordance routes through visibleActions' canReport.
The gap is the other half of the contract. This PR makes the questions the operator's, but SahajCloud's delivery job still understands one key — message. Two findings are that gap; the third is a loading state rendered as a failure.
Findings
blocker— the emailed report is blank unless a field is namedmessage(mutate.ts:316).should-fix— a textarea gets a 5000 bound onlymessageis allowed (report-form.ts:66).should-fix— a pending form read shows an error (use-report-form.ts:42).
What was checked
grep openReport finds only SettingsMenu and Fallbacks, and DrawerErrorFallback reaches visibleActions through FallbackPanel, so the unset-form gate is complete. Read on SahajCloud main: submissionData.ts, deliverContact.ts, submissionContext.ts.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
SahajCloud's delivery job renders the email body from one key — `deliverContact.ts` reads `readSubmissionValue(submissionData, 'message')` — and rebuilds its context block from five fixed names. Every other authored answer reaches the row and stops there. Since #216 the operator names their own fields, and nothing on either side pins `message`. So a form whose textarea is called anything else delivered an empty email while the sender was shown the thank-you screen — the exact failure this form exists to prevent. Every fixture in `src/mocks/report-form.ts` happens to name its textarea `message`, which is why the suite stayed green over it. The first textarea now also travels as `message`, and the authored copy wins the collision so a form that did name one keeps its own answer. The answer still reaches the row under the question the operator asked. Rendering the authored pairs into the email instead is SahajCloud's half, and would let this pair go. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_016UK7FkyZWpCTU5pYgK11ib
The collection keys `VALUE_MAX_LENGTHS` on the submission KEY: only `message`, `note` and `error` are raised to 5000, and every other name takes the 2000 default. This form bounded by the block type instead, so a textarea the operator named anything else offered 5000 in the control and accepted 5000 in the schema, then lost the whole submission to a bare `ValidationError` — no code, no field named, everything the viewer typed gone. That is the loss the bound exists to prevent. `userSubmissionValueMax` mirrors the raised keys beside `USER_SUBMISSION_VALUE_MAX`, and the schema, the control's `maxLength` and the "too long" copy all read it, so the three cannot disagree about where the viewer is stopped. `REPORT_MESSAGE_MAX` goes with it: the ceiling was never this form's to choose. Every fixture in `src/mocks/report-form.ts` names its textarea `message`, which is why the suite stayed green over this. Both new specs pin a renamed one. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_016UK7FkyZWpCTU5pYgK11ib
The modal had only `data` to go on, so `undefined` meant both "still reading" and "could not be read", and it rendered the second — a danger alert. The report affordances gate on the CONFIG, which resolves a round trip ahead of the form itself, so a viewer who opened the settings menu in that window was told something went wrong and handed a working form a moment later. On the one screen reached because something already failed, a false alarm is the worst available guess. `useReportForm` now returns `isPending` beside the form, and the modal renders a spinner for it. `reportFormPending` holds the decision, because the trap is not the ternary: a DISABLED query stays pending forever in React Query, so "this atlas names no form" has to read as settled or the modal waits on a read that will never run. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_016UK7FkyZWpCTU5pYgK11ib
|
Three findings, all adopted, pushed as
Gates: lint, typecheck, 1590 tests, build, One thing needs you: rendering the authored pairs into the email is SahajCloud's half, and would retire the 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
|
@sydevs-bot The PR description contains no actual preview links for me to review. Find and create appropriate links |
|
Preview links are now in the description.
Both deploys are green on Start with Ladle. It renders the whole form off fixtures, with no CMS involved. ⚠ The app preview offers no report control at all, and that is the feature. No code changed, so nothing was pushed. 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
`PinnedToCms` named a category where the producer has a name, and `CmsFormField` / `CmsBlock` carried the same habit into the helpers. The pin reads against SahajCloud's own generated types, so it now says so: `PinnedToSahajCloud`, `SahajCloudFormField`, `SahajCloudBlock`. The preference is codified where a later file will be read against it — `src/AGENTS.md`'s naming list and `docs/rules/data-layer.md`'s generated-types section, which loads on `src/types/**`. Two reductions in the same file: the three blocks whose authored default is prose share one `textInput` shape, and the checkbox block fits one line. The key lists in the tuple stay written out. Folding the shared `'name' | 'label' | 'required'` into a generic helper needs `Extract<keyof …>` to type-check, and `Extract` DROPS a renamed member instead of failing on it — the one drift this pin exists to catch, since `renderableFields` swallows an unparseable block by design. That is now a `⚠` in the docblock rather than a thing to re-derive. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_018vGoYUvXqhy2BB4y9AeMSk
`reportMessage` copied the first authored textarea answer under a second key, `message`, because `deliverContact.ts:23` builds the whole email body from that one key and `submissionContext.ts` rebuilds the context block from five more. Every other authored answer reached the row and stopped there. That workaround belongs upstream, and now has a ticket: sydevs/SahajCloud#832 renders a named form's own question/answer pairs into the delivered email, in authoring order, under the labels the operator wrote. This branch assumes it lands as specified — the helper, the `message` field on `ReportPayload`, the pair in `sendReport` and their three specs are all gone, and the answers travel only under the names the operator authored. ⚠ **SahajCloud#832 merges first.** Until it does, a report whose textarea is not named `message` delivers an email with an empty body. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_018vGoYUvXqhy2BB4y9AeMSk
The modal branched on `isPending` itself, and `reportFormPending` existed to tell that state apart from a failed read. Both are gone. The two states now reach the mechanism built for each: a Suspense fallback renders the spinner, and an ErrorBoundary renders the alert. The mount moves inside the app's Suspense boundary, and stays outside its ERROR boundary — the error CTAs must still open this modal while `ErrorFallback` is on screen. Both new boundaries sit INSIDE `ModalContent`, not at the mount. A viewer who pressed "Report an issue" keeps a titled, dismissable dialog either way, and the app's own `LoadingFallback` never stands in for one modal's read. `useReportForm` keeps its non-suspending reads and now answers `formId` beside `enabled`. Two of its three callers are error fallbacks: a gate that suspended would blank the screen a viewer reached because something already failed, and one that threw would take it down. It also keeps the form read mounted for the widget's whole life, so the read still happens while the page is healthy and `useReportFormDocument` resolves it from cache — the report path is mostly reached FROM a failure, often the network. `reportFormSuspenseQuery` is `reportFormQuery` minus `enabled`, since a suspending read cannot be switched off. One query key, so the warm read and the suspending one cannot drift. `use-report-form.test.ts` goes with `reportFormPending`: the four states it pinned are no longer a decision this code makes. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_018vGoYUvXqhy2BB4y9AeMSk
|
Three threads, three commits, all resolved — lint, typecheck and 1582 tests green on
Round three adds no assertion, and the body says so rather than implying coverage. 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Query factories live in `config/api/index.ts`. Three are declared in `fetch.ts` instead — `eventTitlesQuery`, `atlasConfigQuery`, `translationsQuery` — and each has the same excuse: `fetch.ts` itself calls it, in `loadTitles` or a bootstrap warm-up, so declaring it in `index.ts` would close a cycle against the import already there. Nothing in `fetch.ts` calls either report-form factory. They had no excuse, only the neighbouring one, so they move to `index.ts` with `clientQuery`, `eventQuery`, `regionQuery` and the rest. `reportFormSuspenseQuery` was never re-exported, so `use-report-form.ts` reached into `fetch.ts` for it while importing its twin from the barrel — the split the barrel exists to prevent. Both now come from one place. The docblock describing `reportFormQuery` had been stranded above `reportFormSuspenseQuery`'s own, where TypeScript attaches neither to it. It is back on the function it describes, and says why the cast is unreachable. `docs/rules/data-layer.md` gains the rule, since the placement was prose nowhere and the test for it — does `fetch.ts` call this factory? — is not guessable. No behaviour change: same keys, same windows, same eager graph. Lint, typecheck and 1582 tests green, and the build measures 301.6 / 303.5 / 2.6 KiB, unchanged. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VEMbghy1kqLiDQaXoVghFb
|
One thread, one commit — Adopted
The three that stay in Two things fell out of the move: The placement rule is now in 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
One conflict, in `CHANGELOG.md`: both sides appended a link definition to the same block. Both entries stay, in number order — #216 is this branch's, #220 came with `main`. Everything else merged on its own. `src/config/api/fetch.ts` took both sides: `main`'s `verificationStage` select and unverified-last partition, and this branch's `getReportForm` plus the `reportIssueForm` key on the config select. The two touch no shared line and no shared contract. Lint, typecheck and 1612 tests green on the merge. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_016ier5QxJARVCvn1PfGQHw9
|
Merged
Lint, typecheck and 1612 tests green on the merge. 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
⚠ Merge order
sydevs/SahajCloud#832 merges first. Round three (below) removed this branch's
messageworkaround on the reviewer's instruction, so until #832 ships, a report whose textarea is not namedmessagedelivers an email with an empty body. Everything else in this PR is independent of it.Summary
sy-atlas-config.reportIssueForm, which is what the collection has been refusing it for.GET /api/forms/:id. The widget keeps the Turnstile gate, the refusal copy and the honest thank-you screen.Changes
src/lib/report-form.ts— the pure derivation: which blocks render, the validation each implies, the answers they produce. Fields register by POSITION, because an operator-typed name may contain.or[], which react-hook-form reads as a path;reportAnswersre-attaches the authored name SahajCloud matches on.src/types/report.ts— the form's wire shape, pinned to the generated SahajCloud types (PinnedToSahajCloud). Load-bearing here:renderableFieldsdrops a block it cannot parse, so without the pin a renamed member would turn an operator's question into a field that silently stops rendering.src/components/molecules/Fallbacks/Fallbacks.tsx—canReport, a newSurfaceLimitsentry, so the gate lives invisibleActionswith every other action decision.src/hooks/use-report-form.ts—useReportForm(the non-suspending gate:formIdplusenabled, and the read it keeps warm) anduseReportFormDocument(the suspending read, for a caller inside a boundary).src/components/organisms/ReportIssueForm/ReportIssueModal.tsx— the chrome plus two boundaries;ReportIssuePanelowns the form and its auto-attached context.src/config/api/index.ts— both report-form query contracts, with every other factory.Two fixes from the adversarial review
message,noteanderrorare raised to 5000 inVALUE_MAX_LENGTHS. A textarea named anything else offered 5000 characters and then lost the whole submission to a bareValidationError— no code, no field named.userSubmissionValueMaxnow feeds the schema, the control'smaxLengthand the "too long" copy alike, andREPORT_MESSAGE_MAXis gone: the ceiling was never this form's to choose.isPendingbranch with a Suspense boundary.A third finding — the email body was blank unless a field happened to be named
message— was fixed here inedbfd87and reverted in round three: it is SahajCloud#832's to own. Every fixture insrc/mocks/report-form.tsnames its textareamessage, which is why the suite stayed green over both.Review round two (
dbc6ffc)useReportFormreturnsenabledbeside the form, anduseReportEnabledis gone — the settings row and both fallback surfaces read one hook. The split saved no fetch, because the modal host mounts the form query for the widget's whole life.Review round three (
7347748,f25883a,ce201be) — three threads, one commit eachPinnedToCms→PinnedToSahajCloud, withSahajCloudFormField/SahajCloudBlock. The preference is codified where a later file gets read against it:src/AGENTS.md's naming list anddocs/rules/data-layer.md's generated-types section, which loads onsrc/types/**. The three prose-default blocks now share onetextInputshape. ThePickkey lists stay written out — folding the shared'name' | 'label' | 'required'needsExtract<keyof …>to type-check, andExtractDROPS a renamed member instead of failing on it, which is the one drift the pin exists to catch.reportMessageis gone, with themessagefield onReportPayload, the pair insendReportand their three specs. feat(email): render an authored form's answers in the contact email SahajCloud#832 renders a named form's own question/answer pairs into the delivered email, and this branch now assumes it lands as specified. See the merge-order warning above.<Suspense>and stays outside its ERROR boundary, since the error CTAs must still open the modal whileErrorFallbackis on screen.isPendingandreportFormPendingare both gone. Both new boundaries sit INSIDEModalContent: a Suspense fallback renders the spinner, an ErrorBoundary renders the alert. At the mount instead, the app's ownLoadingFallbackwould stand in for one modal's read, and a viewer who pressed the button would lose the dialog.useReportFormkeeps its non-suspending reads on purpose — two of its three callers are error fallbacks, where a suspending gate would blank the screen and a throwing one would take it down — and it keeps the form read mounted for the widget's life, souseReportFormDocumentresolves from cache.Review round four (
96eef22) — one threadBoth report-form query factories move to
src/config/api/index.ts, whereclientQuery,eventQuery,regionQuery,eventsQueryandregionsQueryalready live. Three factories are declared infetch.tsinstead, and each has the same excuse:fetch.tsitself calls it —eventTitlesQueryinloadTitles,atlasConfigQueryandtranslationsQueryin the bootstrap warm-ups — so declaring it in the barrel would close a cycle against the import already there. Nothing infetch.tscalls either report-form factory, so neither had that excuse; they had inherited the neighbouring one.Two things fell out of the move.
reportFormSuspenseQuerywas never re-exported, souse-report-form.tsreached intofetch.tsfor it while importing its twin from the barrel — the split the barrel exists to prevent. And the docblock describingreportFormQueryhad been stranded abovereportFormSuspenseQuery's own since round three, where TypeScript attaches neither to it; it is back on the function it describes.docs/rules/data-layer.mdgains the placement rule, since it was prose nowhere and the test for it — doesfetch.tscall this factory? — is not guessable from the file.Preview
The branch aliases follow the branch, so they carry
96eef22.Start with the Ladle story. It renders the whole form off fixtures, with no SahajCloud involved: the Authored fields section shows prose, a required select, a consent box and a dropped block type in one form.
⚠ The app preview shows no report control at all right now, and that is the feature.
sy-atlas-config.reportIssueFormis unset today — read back over the API atdepth=0with aselect, which returnsdefaultMapCenterand noreportIssueForm. So the settings menu, the error screens and the compact card all correctly offer nothing, which is the third summary bullet above rather than a broken preview.To see the form in the app: name a form on
/admin/globals/sy-atlas-config, then reload the preview and open the settings menu → Report an issue. SahajCloud already holds Contact Form (id 1:name,email, a requiredmessagetextarea, submit label "Submit"), so no authoring is needed for a first look. Setting the field is safe for production —maindoes not read it yet.⚠ That form's textarea is named
message, the same bias the review pass found. Manual verification step 2 below is the one that matters, and it is the one SahajCloud#832 now owns.Contract impact
src/types/payload/payload-types.tsrefreshed from SahajCloudmain(feat(sy-atlas-config): name the atlas report-issue form on the config global SahajCloud#823 → its #813). The new field isSyAtlasConfig.reportIssueForm.CHANGELOG.mdcarries the host-visible half: the form is SahajCloud-managed, and the affordance disappears where no form is named. No new parameter, no new origin, no CSP change —docs/embedding.mdonly gains the caveat that the form may be absent. None of the four review rounds adds anything a host can observe.Test results
pnpm lint && pnpm typecheck && pnpm test:run— 1582 tests, 123 files, green on96eef22. The count fell from 1590/124 in round three, which deleted specs with the code they covered: the threemessage-pair assertions and all four ofreportFormPending's. Round four changes no count.pnpm sizemeasured on96eef22: standalone 301.6 / embed 303.5 / loader 2.6 KiB against 308 / 308 / 3.5 — byte-identical to3adac32, which is the check that matters for a move between two modules both already in the eager graph.reportAnswerscounting only answerable fields, the schema passingrecipientthrough, the copy fallback overriding an authored label, the report gate removed, the schema and then the control bounding by the block type again.renderToStaticMarkup, so only jsdom can reach it — andreportFormPending, the pure half that carried the decision, no longer exists. Round four is a declaration move with no behaviour to assert, though the typecheck does prove the barrel resolves. What a spec could still cover is thatreportFormQueryandreportFormSuspenseQueryshare one query key; say so and I will add it.Manual verification
This needs a SahajCloud the reviewer can author in — none of it is reachable from a unit lane.
contactform with a recipient, name it on/admin/globals/sy-atlas-config, open Report an issue on the preview and submit. ExpectPOST /api/user-submissions→ 201 withformin the body, a row in/admin/collections/user-submissions, and mail to that form's recipient.messageand submit again. ⚠ This one fails until SahajCloud#832 ships: the row carries the prose under the authored name, and the email body is empty. The control must still stop at 2000 characters.GET /api/forms/<id>response in the network tab: norecipient, noclientkey.reportIssueForm, reload, and confirm the settings menu and the error fallbacks offer no report control.selectand acheckboxand submit: each answer should appear in the row under its authored name.Notes for reviewer
App.tsxalready records for not splitting the modal.translations.test.tsfails on in both directions.textareakeepsREPORT_MESSAGE_MIN. A reviewer may disagree — it is the widget imposing a floor on an authored question — but it is what keeps "at least %{min} characters" describing something real. Its ceiling is no longer ours at all.defaultValue: trueopens pre-ticked. That is the operator's choice to make, but worth knowing before someone authors a consent that way.skipTokenin place ofenabledon the form query (React Query's exportedskipTokenwidens tosymbolthrough a ternary here and the factory stopped type-checking — the key carries the real id ornullinstead).Detail
Fixture pre-mortem.
src/mocks/report-form.tsassumes SahajCloud's form-builder block shapes —name/label/required/defaultValue,optionsas{label, value}, prose as a Lexical root. Verified againstexport interface Forminsrc/types/payload/payload-types.ts, and now pinned there byPinnedToSahajCloudso the check survives the next resync. Its textareas are all namedmessage, which is the bias that hid two findings.Why the answers go first in
submissionData. Both sets are allowed keys, so an operator authoring a field calledlocalewould otherwise replace the locale the widget is actually running in. Authored values are not clamped — they are prose a person wrote, and the controls bound them instead, which is the rulecreateRegistrationalready follows.Country and state render as text inputs. The widget has no authored option list for either, and the answer travels as a string whichever control collects it. Dropping them would lose a question the operator asked, silently.
Prose renders as text, not HTML.
lexicalToHtmlwould need the DOMPurify pass that goes with it, and this form is in the eager graph.lexicalToTextis already there.Reviewed at branch level by four quality lenses plus the security sweep (
src/config/api/matchessecurityReview.triggerPattern). The security pass came back clean, having checked the authored-content sinks, therecipient/clientexposure, the collision ordering above, and the Turnstile handling.Closes #216
🤖 Written by the sydevs autonomous loop — see what this is
🤖 Generated with Claude Code
https://claude.ai/code/session_01VEMbghy1kqLiDQaXoVghFb