Repository navigation
docs(SelectableCard): the showcase and elevated examples are multi-select - #14030
Conversation
…lect SelectableCard is a checkbox, but its showcase and elevated examples built a single-choice picker from checkboxes: each card's onChange forced its own id as the only selection, so a card could not be turned off and assistive technology announced a multi-select group. Both examples now keep a Set and toggle each card on its own; the showcase is an add-on picker.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec a316568 |
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
Approved: CI has finished on this head and every check passed.
Both examples now let each card turn on and off on its own, which matches what SelectableCard is for: its record keeps single-select out of the component, and each card's onChange(!isSelected) now adds or removes only that card's id. Nothing needs to change in this pull request.
Claims and files checked
Review mode: same-head; reason: none
- Live title: "docs(SelectableCard): the showcase and elevated examples are multi-select"; changed rules (0): none.
- Claim: the showcase and elevated examples are multi-select (title and release note): verified; each block keeps a
Setand changes one id per card (SelectableCardShowcase.tsx:32-51,SelectableCardElevated.tsx:16-35). - Claim: each card is a checkbox that toggles on its own, so the examples no longer show a single-choice picker (release note and description): verified for all five cards through
SelectableCard.tsx:463-469. - Claim: the showcase is an add-on picker for storage, priority support and backups: verified (
SelectableCardShowcase.tsx:10-29). - Claim: before this change a selected card could not be turned off, picking one cleared the others, and assistive technology still announced independent checkboxes: reported; the base code sets a single id on every change.
- Claim: the component's record makes each card a native checkbox that toggles with
onChange(!isSelected), and its docs advise against single-select: verified (record AR1 and FR2;SelectableCard.doc.mjs:17). - Claim: the showcase description drops the single-select wording, the elevated description says each card toggles on its own, and the elevation lesson is unchanged: verified (
SelectableCardShowcase.doc.mjs:10,SelectableCardElevated.doc.mjs:10,SelectableCardElevated.tsx:36). - Claim: no single-select pattern is added: verified; the only other file is the release note.
- Claim: a jsdom check clicking every card twice passes after the change and fails before it: reported.
- Claim: ESLint, Prettier, the build, the CLI typecheck, the repository checks and changeset coverage pass: verified by CI at this head (build, typecheck and the Lint workflow); the changeset-format check is reported.
- Claim: the CLI tests pass apart from one failure caused by the test machine: reported; every Node test shard passes in CI at this head.
- Claim: the sandbox site build fails the same way on the base and the branch on the test machine: reported.
- Claim: the two open SelectableCardGroup pull requests do not overlap these examples: verified from their file lists; that they wait on an owner decision is reported.
- Claim: documentation only, no generated artifact to update, and no internal context: verified; no other committed file copies the old examples or descriptions, and the added text carries no internal references.
- File
.changeset/selectable-card-examples-multi-select.md: clear. - File
packages/cli/assets/templates/blocks/components/Card/SelectableCardElevated.doc.mjs: clear. - File
packages/cli/assets/templates/blocks/components/Card/SelectableCardElevated.tsx: clear. - File
packages/cli/assets/templates/blocks/components/Card/SelectableCardShowcase.doc.mjs: clear. - File
packages/cli/assets/templates/blocks/components/Card/SelectableCardShowcase.tsx: clear.
Reader impact
A builder who copies the SelectableCard showcase or elevated example gets a single-choice picker made of checkboxes: clicking a card forces it to be the only selection, a selected card cannot be turned off, and assistive technology still announces a multi-select group of independent checkboxes. After this change both examples show SelectableCard as it is meant to be used, a multi-select where each card toggles on its own.
Source of truth
component:SelectableCard: each card is a native checkbox (AR1) andonChange(!isSelected)toggles it (FR2), and the component docs say not to use it for a single-select group. The examples must match that.Correction
SelectableCardShowcase: was a plan picker that kept one id (setSelected(plan.id)on every change). It is now an add-on picker (storage, priority support, backups) that keeps aSetand adds or removes each card's id with theisNowvalueonChangepasses. Its description no longer says "single-select radio behavior".SelectableCardElevated: kept one id the same way. It now keeps aSetand toggles each card; its description says each card toggles on its own. The elevation point it teaches is unchanged.Evidence
pnpm buildand the CLI typecheck (template docs and strict) pass;pnpm check:repopasses;changeset-coveragepasses against v0.7.17.Scope
Components: SelectableCard (CLI example blocks)
Overlap checked: #13733, #13734 (they add SelectableCardGroup, the future single-select pattern, and wait on an owner decision; this PR only corrects the existing multi-select examples)
Testing
pnpm --filter @astryxdesign/cli typecheck;pnpm check:repo;pnpm check:changesets;node scripts/release/changeset-coverage.mjs pr.packages/cli/test: 623 pass. The one failure,global-local.rows-40-59G59 (Yarn Plug'n'Play), comes from the test machine, not from this change: its Node binary was namednode-linux-x64, so Node's warning hint readnode-linux-x64 --trace-warningsand the test's filter fornode --trace-warningsdid not remove it. With the same binary namednode, G59 passes on this branch.apps/sandbox,verify-export.mjs) stops at "404 or template assets missing" on the test machine both on the base commit and on this branch, identically, so it is not caused by this change; CI's sandbox job runs the real check.