Skip to content

docs(SelectableCard): the showcase and elevated examples are multi-select - #14030

Merged
cixzhang merged 1 commit into
mainfrom
l0/selectable-card-examples-multi-select
Nov 29, 2026
Merged

cixzhang merged 1 commit into
mainfrom
l0/selectable-card-examples-multi-select

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

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) and onChange(!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 a Set and adds or removes each card's id with the isNow value onChange passes. Its description no longer says "single-select radio behavior".
  • SelectableCardElevated: kept one id the same way. It now keeps a Set and toggles each card; its description says each card toggles on its own. The elevation point it teaches is unchanged.
  • A single-select pattern is not added here.

Evidence

  • A jsdom check rendering both examples and clicking every card twice: with this change every card turns on, then off again, from its initial state (2/2). On the examples before this change it fails (2/2), since a selected card cannot be turned off and selecting one clears the others.
  • pnpm build and the CLI typecheck (template docs and strict) pass; pnpm check:repo passes; changeset-coverage passes against v0.7.17.

Scope

Components: SelectableCard (CLI example blocks)

  • This PR changes documentation only, or names every necessary generated artifact.
  • Runtime, API, visual, and policy changes were removed or split.
  • Public text and artifacts contain no internal Meta context.

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

  • ESLint and Prettier on the changed files; pnpm --filter @astryxdesign/cli typecheck; pnpm check:repo; pnpm check:changesets; node scripts/release/changeset-coverage.mjs pr.
  • The toggle check above, run on both examples before and after the change.
  • packages/cli/test: 623 pass. The one failure, global-local.rows-40-59 G59 (Yarn Plug'n'Play), comes from the test machine, not from this change: its Node binary was named node-linux-x64, so Node's warning hint read node-linux-x64 --trace-warnings and the test's filter for node --trace-warnings did not remove it. With the same binary named node, G59 passes on this branch.
  • The sandbox site build (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.

…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.
@vercel

vercel Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 29, 2026 11:34am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 29, 2026
@astracat-bot

astracat-bot Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 29, 2026, 2:49 PM UTC

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec a316568

@github-actions

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · a316568

Storybook · Sandbox · built from this PR's head

Package size: @astryxdesign/cli 6.33 MB packed (+99 B); no new dependencies.

Not run on this PR: add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 Set and 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.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review November 29, 2026 14:22
@cixzhang
cixzhang merged commit 76ab756 into main Nov 29, 2026
147 checks passed
@github-actions
github-actions Bot deleted the l0/selectable-card-examples-multi-select branch November 30, 2026 06:03

This branch was successfully deployed

1 active deployment
Preview — a3165687 Deployed Nov 29, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant