Skip to content

docs(contracts): M1 DataEntry contracts — FormField, TextField, SelectField, DateField, NumberField, CheckboxField - #272

Merged
ctwoodwa merged 1 commit into
mainfrom
docs/adr0017-m1-contracts-forms
Jun 4, 2026
Merged

docs(contracts): M1 DataEntry contracts — FormField, TextField, SelectField, DateField, NumberField, CheckboxField#272
ctwoodwa merged 1 commit into
mainfrom
docs/adr0017-m1-contracts-forms

Conversation

@ctwoodwa

@ctwoodwa ctwoodwa commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Authors Semantic + Interaction contracts for the six shipping DataEntry
components per ADR 0017-A1 Phase M1 reverse-spec workflow:

  • DataEntry/FormField.Semantic.md + .Interaction.md
  • DataEntry/TextField.Semantic.md + .Interaction.md
  • DataEntry/SelectField.Semantic.md + .Interaction.md
  • DataEntry/DateField.Semantic.md + .Interaction.md
  • DataEntry/NumberField.Semantic.md + .Interaction.md
  • DataEntry/CheckboxField.Semantic.md + .Interaction.md

Each Semantic contract carries the ADR 0110 Definition of Done block citing
the demo-story and visual-test gates (baseline PNG path:
src/components/forms/__screenshots__/).

FormField is documented as the WCAG 2.2 AA compliance mechanism: the
FormFieldContext.describedBy wiring is specified in §6 of the
FormField.Semantic.md, and every field component's Semantic contract
documents how it consumes useFormField() per the directive note.

Native-input components (TextField, DateField, NumberField) and Radix-built
components (SelectField, CheckboxField) are contracted honestly. Known gaps
are flagged as council open questions:

  • No HTML attribute passthrough on any field root.
  • No onBlur / onFocus callbacks (host owns blur-commit semantics).
  • CheckboxField filters out Radix's 'indeterminate' payload — tri-state
    is a deferred feature.
  • NumberField does not suppress mouse-wheel scroll while focused (known
    browser papercut).
  • DateField uses the native <input type="date"> picker — appearance and
    some keyboard nuances are browser-owned.

Every contract remains in Draft state per ADR 0017 §A1.4.

Scope

  • Engineer-owned contract types only (Semantic + Interaction).
  • PAO Styling + Accessibility contracts are authored concurrently in the
    companion PR (no cross-dependency — separate file paths).
  • Re-spec from shipping code on origin/main; no implementation changes.

Verification

  • git show origin/main:packages/ui-react/src/components/forms/<file>.tsx
    read for all six components plus FormFieldContext.tsx; contracts describe
    observed behaviour.
  • The describedBy wiring described in each field's Semantic §3.5 / FormField
    integration section matches the actual useFormField() consumer in source.
  • ADR 0110 Definition of Done block matches the directive verbatim with
    baseline path src/components/forms/__screenshots__/.

Test plan

  • Markdown rendering check (GitHub PR view) — no broken links.
  • CI green (docs-only change; no code paths touched).

🤖 Generated with Claude Code

…tField, DateField, NumberField, CheckboxField

Author Semantic + Interaction contracts for the six shipping DataEntry
components in @sunfish/ui-react, per ADR 0017-A1 Phase M1 reverse-spec
workflow. Each Semantic contract includes the ADR 0110 Definition of Done
block citing the demo-story and visual-test gates.

FormField is the field-wrapper that threads FormFieldContext (describedBy)
to child inputs — the WCAG 2.2 AA compliance mechanism. Every field
component documents its useFormField() wiring per the directive note.

Native-input components (TextField, DateField, NumberField) and Radix-built
components (SelectField, CheckboxField) are contracted honestly: known gaps
(no HTML attribute passthrough, no onBlur callbacks, CheckboxField
indeterminate suppression, NumberField wheel-scroll papercut) are flagged
as council open questions rather than papered over.

Every contract remains in Draft state — the frontend-architect council
flip to Accepted lands separately, per ADR 0017 §A1.4.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@ctwoodwa, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 47 minutes and 23 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4c2e751e-9f52-4804-8288-25b058b17036

📥 Commits

Reviewing files that changed from the base of the PR and between e24d9bc and 61e5ebd.

📒 Files selected for processing (12)
  • packages/ui-core/Contracts/DataEntry/CheckboxField.Interaction.md
  • packages/ui-core/Contracts/DataEntry/CheckboxField.Semantic.md
  • packages/ui-core/Contracts/DataEntry/DateField.Interaction.md
  • packages/ui-core/Contracts/DataEntry/DateField.Semantic.md
  • packages/ui-core/Contracts/DataEntry/FormField.Interaction.md
  • packages/ui-core/Contracts/DataEntry/FormField.Semantic.md
  • packages/ui-core/Contracts/DataEntry/NumberField.Interaction.md
  • packages/ui-core/Contracts/DataEntry/NumberField.Semantic.md
  • packages/ui-core/Contracts/DataEntry/SelectField.Interaction.md
  • packages/ui-core/Contracts/DataEntry/SelectField.Semantic.md
  • packages/ui-core/Contracts/DataEntry/TextField.Interaction.md
  • packages/ui-core/Contracts/DataEntry/TextField.Semantic.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/adr0017-m1-contracts-forms

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ctwoodwa
ctwoodwa marked this pull request as ready for review June 4, 2026 04:47
@ctwoodwa
ctwoodwa enabled auto-merge (squash) June 4, 2026 04:49
@ctwoodwa
ctwoodwa merged commit ff97c00 into main Jun 4, 2026
19 checks passed
@ctwoodwa
ctwoodwa deleted the docs/adr0017-m1-contracts-forms branch June 4, 2026 04:49
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