Repository navigation
feat(forms): one form kit — field wiring, group fields, choice cards, one field height - #501
Conversation
|
🤖 no session running recent dispatchesWritten by the sydevs dispatcher. Sessions never edit this comment. |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
sahajatlas-design | c536549 | Nov 26 2026, 05:53 PM |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
The shape is right. One FormField render prop replaces the wiring each form assembled by hand, and the registration date as a Select beats a collapsing radio list.
Two claims do not hold. The headline change — fields grow 40→44px on touch — is a no-op: pointer-coarse:min-h-11 already won over h-10, so every fieldChrome field was already 44px there. And the new kit paragraph enrols Combobox and Checkbox, neither of which can take FieldControlProps; the diff's own checkbox branch proves it.
No contract surface is touched: no Payload types, no docs/embedding.md, no CSP. show_more_dates is correctly retired against sydevs/SahajCloud#1282.
Findings
- should-fix —
Select.tsx:25: the 40→44px claim is a no-op. Correct the body and step 2. - should-fix —
DESIGN_SYSTEM.md:83: the kit names two atoms the render prop cannot wire. - should-fix — Streamline:
ToggleGroup.tsx:126(required, whichSearchFilters.tsx:266does at the caller),FormField.tsx:130(fieldDescribedBy, one caller),FormField.stories.tsx:162(copy). - consider —
RadioGroup.tsx:24: three capabilities land with no caller onmain. - consider —
FormField.tsx:150: a self-labelled control gets a second visible label.
What was checked
Read whole on the branch: FormField, Select, ToggleGroup, RadioGroup, Input, Textarea, Combobox, Checkbox, both forms, tv.ts, globals.css, and both docs. Ladder walked for field-height, FieldControlProps, FieldTarget, withIcon.
Grepped every caller of the removed and added API: collapseAfter, moreLabel, show_more_dates, size="md", required, as="fieldset", atoms/RadioGroup. SortMenu and SettingsMenu use Radix's own. Every path the body names exists.
Streamliner: 16 pieces covered, 12 kept, 3 of 4 sketches posted.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
… one field height Every form now builds from FormField around the shared atoms, and no form hand-rolls a field shell, radio or segmented control. - FormField hands its control the wiring (id, aria-describedby, aria-required, isInvalid) through a render prop, and gains a group form (`as="fieldset"`: a legend, keyed by `name`, that the group points back at). - `field-height` (globals.css): 40px with a mouse, 44px on touch, on `fieldChrome`, so every field in every form is one size. It replaces the fixed h-10 and the pointer-coarse min-height (#432). - ToggleGroup: `size="md"` (the field height), `required` (a re-press keeps the answer), aria-labelledby/aria-required. - RadioGroup: an option with `icon` and `hint` is a choice card; the root takes a caller's layout. - Select forwards its ref to the trigger and takes an `id`, so a label names it and react-hook-form can focus it after a failed submit. - Report an issue and Registration wire every field through FormField. The registration start date is a Select dropdown; `registration.form.show_more_dates` has no caller left and is listed as retiring. - Ladle: Molecules / Form Field with a "Form atoms" section showing the set. - DESIGN_SYSTEM.md and src/components/AGENTS.md say every form is one kit. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
tailwind-merge did not know our `field-height` utility, so a textarea shipped `field-height h-auto` and stylesheet order alone decided its height. `@/styles/tv` now registers it as a height, and a spec pins it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- ToggleGroup: the minimum widths belong to `sm`; `md` is the field height alone, and the caller's grid sets its own gap (the md gap compound never reached the root). `required` is enforced at the item click, so it holds uncontrolled too; `aria-required` only on the single choice's radiogroup. - RadioGroup: the collapse-and-reveal feature lost its only caller with the date dropdown, so it goes; a choice card is `relative`, keeping its hidden radio inside the card in a scrolling body. - FormField: a fieldset must name itself (type-level); a self-labelled control (the report form's checkbox) keys its help and error by `name`, so its aria-describedby now resolves. The id helpers leave the barrels. - Report: the select drops an aria-label that overrode its linked label. - Registration: options are plain strings (Radix reads type-ahead from the item text); an empty value is '' rather than undefined. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… checkbox - Checkbox takes aria-labelledby and aria-required, so ReportIssueForm spreads the field's wiring onto it as it does every other control. - FormField renders no <label> for a control that labels itself (`name` without `htmlFor`); the checkbox showed its label twice. - fieldDescribedBy had one call site left, so it folds into FormField. - The kit list drops Combobox, which takes no wiring; the Form Field story describes what a viewer sees, not the API. Co-Authored-By: Claude Opus 5.5 <[email protected]>
0b8e58e to
c536549
Compare
…eld (#510) * feat(a11y): one focus outline, and forms that start in their first field Keyboard focus drew three styles: Button's ring with an offset, every other atom's ring without one, the geocoder's box-shadow, and Mapbox's blue halo on its credits button even for a mouse click. A `focus-ring` utility replaces all of them: a 2px inset outline in the focus colour with a 2px band of the panel's colour inside it, so it survives an overflow clip and shows on a filled control of its own hue. `focus-ring.test.ts` refuses a control's own ring. `touch-target` now asks `useCoarsePointer`'s question, `(hover: none) and (pointer: coarse)`, so a touchscreen laptop's mouse meets no invisible area. The geocoder's 20px clear button gains the same 44px area through its sheet. The Modal atom starts a dialog holding a field in that field rather than on its ×; on a touch-only screen the dialog itself takes focus, so no keyboard rises unasked. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(a11y): the choice card draws the shared focus outline #501's choice card rings itself with `has-[:focus-visible]:ring-2 ring-focus` while its radio is hidden behind the icon: a third style, and on the checked card in dark mode a ring in the fill's own colour. It takes `focus-ring-within`, the same drawing as `focus-ring` on a box whose focus lands on a hidden control inside it. The drawing itself is `focus-outline`, which the Mapbox rules also apply now, since their selectors already name the state. The drift spec reads a ring behind any focus state, `has-[…]` included. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(a11y): keep the guide and gate edits to their own lines The first pass ran Prettier over the whole of src/components/AGENTS.md and scripts/check-a11y.mjs, re-padding tables and requoting strings no change here touched. Both now carry only the touch-target query and the focus-outline note. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor: simplify per /simplify pass - One `TOUCH_ONLY_QUERY` in `config/responsive.ts`, read by `useCoarsePointer` and the Modal, and pinned against `touch-target` by the spec rather than a second literal. - `focus-outline` is Tailwind's own outline and inset-ring utilities, not a hand-copied `--tw-*` shadow stack. The choice card takes it behind `has-[:focus-visible]:`, so the one-call-site `focus-ring-within` goes. Of the Mapbox resets only the credits button's halo needed one. - The geocoder's clear button takes `touch-target` and `focus-ring` from `MapSearch`'s wrapper: search-js-web nests no shadow root, so the copied `::after` and outline in its sheet go. - The Modal focuses the dialog, then the first field once one exists, so the report form behind its spinner starts in its first field too; a dialog with no field no longer opens on its ×. The swallowed `<select>` and hidden fields leave the selector. - The carousel's touch spacing follows the tap areas it makes room for. Co-Authored-By: Claude Opus 5.5 <[email protected]> * style(select): class order after the rebase Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(changelog): link the focus and tap-area entries to #510 Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(a11y): address the adversarial review - The Modal's field selector and finder fold into their one caller. - The component guide points at `TOUCH_ONLY_QUERY` and the focus spec instead of restating the query, the outline's mechanism and the spec's rule. - `focus-ring.test.ts` pins the geocoder field's hand-copied outline against `focus-outline`, which its sheet cannot apply. - MapSearch's wrapper reaches the clear × by its seeded `--ClearBtn` suffix, not every `<button>` under it. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…t stop The walk presses Tab once per tabbable element, but a roving-tabindex group (#501's weekday picker) is one Tab stop holding seven, so on molecules--form-field the walk outlasted the page, wrapped to ff-name and reported it as a backwards jump. main has failed the gate since #501 and #510 landed together. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…isitor's own format (#509) * feat(dates): every date and time through one Intl formatter, in the visitor's own format Dates and times now go through src/lib/time.ts in regionalLocale(locale): the browser's first language decides, so an en-GB browser reads "17:45–18:45" and "Wed 18 Nov", en-US "5:45 – 6:45 PM" and "Wed, Nov 18", and a browser whose first language is another keeps that language's clock on the English page (cs-CZ "17:45", a Brazilian browser on en-BR-u-hc-h23). - Times use timeStyle 'short', so whole hours keep their minutes. - A range that wraps past midnight and runs 12 hours or more writes both day periods ("5:00 PM – 12:00 PM", not "5:00 – 12:00 PM"). - A year joins a date only when it is not this year. - Callers: useEventDisplay, the filter time labels, ActiveFilterPills, SearchFilters (weekdayNames instead of luxon's Info.weekdays), the registration dates, and the calendar header; the Schedule-X grid runs regional English as en-GB or en-US by date order (scheduleXLocale). - Distances follow the same locale: miles for a UK or US region. - src/AGENTS.md gains the "Dates and times" rule. Main's #380 clock rule is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor: simplify per /simplify pass - useLocale() returns formatLocale, so callers stop deriving regionalLocale themselves, and formatTimePeriods takes it like its siblings. The specs' useLocale mocks pin it, so they no longer read the machine's own locale (use-event-display.test.ts failed on an en-GB machine). - formatTimeRange: the wrap-past-midnight join fires only when formatRange actually collapsed a day period, reading the separator off the same parts; a 24-hour locale keeps its own range and suffix ("17:00–12:00 Uhr"). - wallClock replaces events.ts's hourClock; formatDate drops its test-only `now` for luxon's Settings.now; usesMiles and dayFirst lose catches that guarded nothing; scheduleXLocale loses an unreachable row. - Shorter comments and src/AGENTS.md rule; duplicate tests removed. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(dates): a Portuguese browser keeps the calendar grid in Portuguese The regional locale hands Schedule-X the browser's own Portuguese tag (pt-PT, pt), which matched no entry and fell back to en-US. Key the table by language so every Portuguese tag runs pt-BR, as main did. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(dates): state the rule in the spec comments, not who asked for it Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(dates): a webview with no navigator.languages formats in the page's locale Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(i18n): formatLocale formats, and is never a locale the widget fetches Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(changelog): link the date-format entry to #509 Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(calendar): Schedule-X's locale lives with the calendar shaping, not the formatters scheduleXLocale is calendar configuration with one caller, so it moves from lib/time.ts into lib/shape/calendar.ts beside the other Schedule-X helpers. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(dates): the dates rule names the module, not its exports Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(a11y-gate): end the keyboard walk when Tab wraps back to the first stop The walk presses Tab once per tabbable element, but a roving-tabindex group (#501's weekday picker) is one Tab stop holding seven, so on molecules--form-field the walk outlasted the page, wrapped to ff-name and reported it as a backwards jump. main has failed the gate since #501 and #510 landed together. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(a11y-gate): index the last stop so the walk typechecks Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(a11y-gate): an unstamped keyboard stop is not a jump to the top A stop the page rendered after the audit carries no data-a11y-order, and Number(null) is 0, so views--event-·-sticky-register failed tab-order at random whenever the audit read the story before it finished rendering. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
|
The session for address-review did not finish after 3 attempts. I have stopped retrying. A 🤖 sydevs dispatcher |
Summary
FormFieldaround the shared atoms.FormFieldpasses each control its wiring, and has a fieldset mode for choice groups.field-height: 40px with a mouse, 44px on touch, as fields already drew. Short choices use a form-sizeToggleGroup; longer or described choices useRadioGroupchoice cards.FormField. The registration start date is now a dropdown (theSelectatom).Change outline
Components — FormField hands its control the wiring
The caller no longer builds the id, describedby or invalid state itself. A group of controls has a single legend naming it.
Behaviour — the kit atoms
Components — the forms on the kit
Preview
Preview pending: Cloudflare has not built the branch yet. Once it has, open:
Test results
test:run(2549 passed), rebased on currentmainrequired(watched failing with the guard off), RadioGroup choice cards,fieldChromeheight merging (watched failing without the tailwind-merge registration)scripts/check-a11y.mjs, 390×844, coarse pointer), on the five changed stories: cleanManual verification
main).Notes for reviewer
mainalready drew 44px on touch throughpointer-coarse:min-h-11;field-heightstates the same sizes as one utility a textarea'sh-autocan replace.mainyet. Once this merges, feat(widget): submit or correct a class, and opt into a mailing list #318 rebases onto the kit and dropsValidatedInput,ChoiceCardandradioKeys.registration.form.show_more_dateshas no caller left, so it is listed inRETIRING_KEYS. chore(translations): drop the retired registration.form.show_more_dates atlas key SahajCloud#1282 drops it fromsy-atlas-translations.main's wording.main: a required block with no copy of ours is still invalid, and fallback text would be new copy.Comboboxtakes noidorref. No form uses it in aFormFieldyet, so it is left out of the kit list instead.Detail
field-heightasks the tap-floor question (pointer-coarse), the same as The atlas widget can be used with a keyboard and a screen reader #432, rather thanfield-size's zoom question. So a narrow desktop window keeps 40px fields.requiredon ToggleGroup started as a filter ononValueChange. That missed the uncontrolled case: withdefaultValue, Radix's own state still cleared. It now prevents the item's click, and Radix skips its toggle when the click is prevented.relative. Otherwise thesr-onlyradio's containing block sits outside a scrolling drawer body, so it does not scroll with its card./simplify(reuse, simplification, efficiency, altitude),/code-reviewat medium,/security-review(styles path trigger; no findings), and the comment lint (clean).🤖 Generated with Claude Code