Skip to content

Add native checkbox, radio group and switch - #106

Draft
pournasserian wants to merge 10 commits into
mainfrom
72-native-choices
Draft

pournasserian wants to merge 10 commits into
mainfrom
72-native-choices

Conversation

@pournasserian

@pournasserian pournasserian commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add FlCheckbox, FlRadioGroup, FlRadioOption, and FlSwitch using native inputs and InputBase. A radio group inside FlField has exactly one group role and one owner for its label, required state, help and errors. Its radios have stable value-based IDs and their own labels and descriptions. Standalone groups require an accessible name.
  • A checked radio submits one option; a checked checkbox or switch submits true. Unchecked and disabled inputs are omitted. The initializer provides mixed checkbox appearance, not a third wire value. Where WASM supplies no framework name, the group uses its stable ID; explicit and framework names still take precedence.
  • Add the choices gallery in static SSR, interactive Server and WASM, with working settings and copyable examples. Checkbox and radio targets stay at least 24 × 24 CSS px in forced colors.

Browser test follow-up

Head c6e570d395cc5c98b8761c7d593e0ba6b2fed89f changes just one test file on the reviewed integration head. No library, gallery fixture, workflow, timeout or skip changes.

  • Windows WebKit 27.2 checked the native radio on a linked label click without moving focus from BODY, in plain HTML and the actual JavaScript-disabled Choices form. A real Tab into that checked radio followed by ArrowDown worked in both. The test still checks compact label activation; it now Tabs to the nearby checkbox and uses Shift+Tab to enter the checked radio, verifies focus, then verifies ArrowDown moves focus and selection past the disabled option.
  • On Windows Firefox 157, the old test stalled before any POST at ToHaveJSPropertyAsync("indeterminate", false). A bounded .NET probe reproduced it with a plain checkbox and JavaScript disabled, while the same assertion returned with scripting enabled. An immediate DOM read returned false on both the plain input and actual static specimen. The test now uses that direct read only on the already-loaded static, script-disabled document. The script-enabled initializer assertions on the same initial specimen remain intact. The timestamped direct-read workflow subsequently completed both real POSTs and their receiver checks on Windows Firefox.
  • Exact new head, isolated Windows ARM64 Release: build passed with zero warnings/errors; Chromium 156.0.8078.4, Firefox 157.0 and WebKit 27.2 each passed 3/3 with no skips. Each tested the actual static JS-off POST workflow and first interactive DOM in Server and WASM, including the initialized mixed checkbox. Full Linux verification on this head is pending.

Both JavaScript-disabled document POSTs must return HTTP 200. The invalid attempt sends only Settings.Schedule=true of the choice values and displays the single group-owned error ahead of help. The corrected attempt sends one Settings.Signup=domain and one Settings.Notify=true; Schedule is off and locked fields are omitted. The receiver must show the saved result.

Earlier integration evidence

  • Merge-only parent f09badb56d4535bc77babf9a1bd37654a4f5d8c5 integrated main 1ce93f664ef599df1700ecb6ad186bb73e2cbe3b: exact C-20: Add FlCheckbox, FlRadioGroup and FlSwitch using native inputs #72 feature delta, sorted 486-signature API union and 21 catalog entries plus /not-found, with C-21: Add FlSegmented as a single-choice radio group #73 group metadata intact. Its isolated Release build, 9 bUnit cases and 18 Windows Chromium browser cases passed. Clean and invalid signup markup, role snapshots and referenced label/help/error texts matched the coordinator's unchanged listener.
  • On that parent, hosted PR CI passed. In nightly 46175562698, Linux WebKit passed 485 tests with one explicit skip; Linux Firefox was canceled at the job limit without a test summary or failure row. The canceled job is not a pass and does not establish the operation that stalled on Linux. A fresh exact-head hosted matrix is separate. Playwright WebKit is not Safari.
  • On earlier feature head 3e4a340, 14 gallery-to-design comparisons matched all 16 measured CSS properties/native state values per control; the forced-color target went from 16 × 16 to at least 24 × 24. Earlier checks also covered the packaged stylesheet and an isolated NuGet consumer. These earlier checks are not relabelled as evidence for the new head.

Manual screen-reader listening is outstanding. Keep this draft open until a person reports group entry, option movement, and invalid re-entry with their screen reader. Axe, DOM, and browser accessibility snapshots do not satisfy that requirement.

Closes #72

@pournasserian pournasserian left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technical re-review of 3e4a340: inspected the sole group owner and native input rendering, updated shared adapter, ID, required and description lifecycles, no-JS request/returned model, and integrated test and packaging evidence. Recorded 35 focused component and 36 focused Chromium passes; automated comparison of the two listening fixtures found equivalent clean/invalid group markup, computed accessibility trees and referenced descriptions. This is not a manual speech observation. Remain draft until the required actual listening result is recorded, then recheck base/head and CI.

@pournasserian pournasserian left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coordinator integrated 533540c into the issue branch (143afd1). Verified all 18 gallery routes and all 418 API lines form the exact duplicate-free union of both parents. Shared field files and the choices fixture are unchanged from the technically reviewed head. Still draft: hold for actual screen-reader listening and green CI, without treating automated group checks as speech.

@pournasserian pournasserian left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed integrated f09badb against 1ce93f6: the same 16 #72 paths, with identical added/removed lines per file to the prior technically reviewed delta. Only shared catalog/context offsets moved. The real radio-group listening check is still outstanding. Full PR CI and cross-browser runs are in flight; this remains a draft.

@pournasserian pournasserian left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed c6e570d: the only change since f09badb is the test driver. The script-disabled checkbox still has to report indeterminate=false; the positive script-enabled checks remain. Clicking its label must check the radio. A separate genuine Tab transition must focus that checked radio before ArrowDown; the enabled next option must receive focus and become checked. Both responses must now explicitly be navigations with HTTP 200. No timeout increases, skips, or library behavior changes. Technical acceptance pending exact CI/full engines; human listening is still a separate gate.

@pournasserian

Copy link
Copy Markdown
Member Author

Manual listening check — result still needed

On the coordinator workstation the fixture is http://127.0.0.1:55403/static/choices#form. The clean and invalid radio-group markup was compared with the reviewed candidate and matched. On another machine, check out this PR in an isolated worktree, run dotnet run --project gallery/Gallery --no-launch-profile --urls http://127.0.0.1:0, and open /static/choices#form at the printed address.

  1. With your screen reader in focus/forms mode, move from In a form into Invited people only. Record what you hear for the Who can sign up group, its help/policy, and this individual option.
  2. Press Down Arrow. Confirm or report whether focus and selection move to Verified domain, skipping the disabled Anyone option.
  3. Reopen the original URL (a fresh GET). Leave the radios unselected, activate Check on server, and return to the group. Record the error, its order relative to the help/policy, and whether it is repeated when moving to another option.

Please record browser and version, screen reader and version, and actual speech/behavior. Exact phrasing can differ by reader. A discrepancy is useful evidence and should not be marked as a pass. No manual result has been supplied yet; axe, DOM snapshots and successful native POSTs are separate evidence.

@pournasserian

Copy link
Copy Markdown
Member Author

Automated gates passed on c6e570d. PR CI 46177893944: 251 component and 485 Chromium passed, one explicit skip. Linux cross-engine run 46177919960: 485 Firefox and 485 WebKit passed, one explicit skip per engine, zero failures. This establishes automated behavior only. The draft remains held for the manual listening result requested above.

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.

C-20: Add FlCheckbox, FlRadioGroup and FlSwitch using native inputs

1 participant