Skip to content

docs: document validation instead of denying it exists - #5

Merged
wolfoo2931 merged 1 commit into
mainfrom
docs/validation
Aug 17, 2026
Merged

wolfoo2931 merged 1 commit into
mainfrom
docs/validation

Conversation

@wolfoo2931

Copy link
Copy Markdown
Owner

The README and landing page claimed there are "no error messages", which is wrong: setTooltipError/Warning/Success/Loading are the library's per-field error channel, and they are what structured-text-editor's reference dialog has always validated with. What is actually missing is declarative validation -- no required, no rules, no schema -- and the fact that a message does not gate the submit on its own.

  • add guide/validation.md: the onFormChange + trigger + tooltip pattern, with a live demo, async checks and their staleness trap, lookup-and-fill, the five levels, and isValidRecord
  • correct the "no validation framework" bullet in README and docs/index
  • reactivity.md: "do not set values in onFormChange" becomes "guard the write" -- filling fields from a DOI/URL lookup is the case it exists for
  • migration-v1.md: note that the v1 validation idiom carries over unchanged
  • cross-link from fields overview, api reference and accessibility, and flag that a field without a tooltip cannot show a message at all

What this changes

Checklist

  • npm run typecheck && npm run lint && npm test && npm run build pass
  • Tests added or updated (a regression test, if this fixes a bug)
  • Documentation updated, if behaviour or the API changed

DOM contract

  • This does not change the rendered DOM, or test/domContract.test.ts
    was updated deliberately and the change is described below

The README and landing page claimed there are "no error messages", which is
wrong: setTooltipError/Warning/Success/Loading are the library's per-field
error channel, and they are what structured-text-editor's reference dialog
has always validated with. What is actually missing is declarative validation
-- no required, no rules, no schema -- and the fact that a message does not
gate the submit on its own.

- add guide/validation.md: the onFormChange + trigger + tooltip pattern, with
  a live demo, async checks and their staleness trap, lookup-and-fill, the
  five levels, and isValidRecord
- correct the "no validation framework" bullet in README and docs/index
- reactivity.md: "do not set values in onFormChange" becomes "guard the write"
  -- filling fields from a DOI/URL lookup is the case it exists for
- migration-v1.md: note that the v1 validation idiom carries over unchanged
- cross-link from fields overview, api reference and accessibility, and flag
  that a field without a tooltip cannot show a message at all
@wolfoo2931
wolfoo2931 merged commit 39b45d4 into main Aug 17, 2026
5 of 6 checks passed
@wolfoo2931
wolfoo2931 deleted the docs/validation branch August 17, 2026 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant