Skip to content

v0.1.2 — mutating-form recipe, CSRF header behavior, boolean-field docs

Latest

Choose a tag to compare

@n-ichimura n-ichimura released this 13 Jun 05:03
· 1 commit to main since this release
c8b772a

Patch release — strictly additive work plus bug fixes, per VERSIONING.md. Markup compatibility with 0.1.1: fully additive, no renames or removals.

Resolves three TesseraQL downstream form-pattern issues (#244, #245, #246) — generated markup is treated as a public contract, so each is now a blessed, versioned pattern — plus a datagrid keyboard-nav fix.

Added

  • mutating-form recipe (#244) — the blessed htmx form composition: POST with inline 4xx field errors (the field-errors fragment swapped into an in-form container), a success redirect (branch on HX-Request204 + HX-Redirect for htmx, plain 303 Location for no-JS), a double-submit guard + busy spinner, a confirmed destructive variant, and a no-JS degradation path. HX-Redirect is blessed over HX-Location (the latter is not post/redirect/get); no new glue behavior. Pinned by a real-htmx browser test. Docs.
  • installCsrfHeader() (#246) — the blessed CSRF token delivery convention. Reads <meta name="csrf-token"> on every htmx:configRequest and attaches it as a request header (default X-CSRF-Token, overridable per page via data-header); read at request time so token rotation just works, never overwrites an explicit data-hx-headers value, inert without the meta tag. Ships in the auto-init ./behaviors bundle. Docs.
  • Blessed boolean field-pattern docs (#245) — "As a boolean form field" on the checkbox page: a hidden false paired with the same-name checkbox true so a form post always carries a value; covers the label-pattern rule and the hc-switch variant. Docs.

Fixed

  • field-errors: same-name groups now resolve to the first visible control (#245). The boolean-field idiom (hidden false + checkbox true under one name) used to wire aria-invalid / aria-describedby / focus / edit-to-clear to the hidden input; hidden members are now skipped when the group has a visible control.
  • hc-datagrid: column-aligned keyboard navigation in multi-row records (#248). The navigation matrix resolves rowspan/colspan into a visual grid so ↑/↓ keep the visual column and a spanning cell is one stop. Single-row grids are unaffected.

Companion CLI release

  • @hypermedia-components/cli@0.1.1 (tag cli-v0.1.1) re-bundles the recipe set so npx @hypermedia-components/cli add mutating-form works. No command or flag changes.

Full details in CHANGELOG.md.