Skip to content

fix(admin): use control-generic wording for selectable prop docs - #4667

Merged
sordaz00 merged 1 commit into
2026-07from
so/fix-control-wording-2026-07
Sep 2, 2026
Merged

fix(admin): use control-generic wording for selectable prop docs#4667
sordaz00 merged 1 commit into
2026-07from
so/fix-control-wording-2026-07

Conversation

@sordaz00

@sordaz00 sordaz00 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #4662, found while fixing the World-side source. Same bug class, different props.

What

Four shared declarations describe themselves as a checkbox. All of them are inherited by components that aren't checkboxes:

String Declared on Renders on
"Whether the checkbox is disabled…" BaseSelectableProps Choice, Option
"The value submitted with the form when this checkbox is checked" BaseSelectableProps Choice, Option
"The text label displayed next to the checkbox…" BaseCheckableProps Switch
"The name used to identify this checkbox…" BaseCheckableProps Switch
"The value used in form data when the checkbox is checked." PreactCheckboxProps / PreactCheckboxElement Switch

BaseSelectablePropsBaseOptionProps → Choice/Option; BaseSelectablePropsBaseCheckableProps → Switch; SwitchProps extends PreactCheckboxProps and class Switch extends PreactCheckboxElement.

Wording

"checkbox" → "control" throughout. State verbs follow each interface's own family vocabulary, which is split in this file:

  • BaseOptionProps family (Choice/Option) uses selected — 5 occurrences, 0 "checked"
  • BaseCheckableProps family (Checkbox/Switch) uses checked — 7 occurrences, 0 "selected"

So BaseSelectableProps, the shared parent of both, uses selected (matching its own name); BaseCheckableProps and the PreactCheckbox* declarations, which cover only Checkbox and Switch, keep checked (matching the checked/defaultChecked descriptions already on them). "control" also matches ui-api-design, the upstream source of truth.

Mentions of "control is checked" remains, as checked is the actual property name, including on Switch.

What's left

The remaining checkbox mentions in components.d.ts are genuinely checkbox-specific: CheckboxProps, CheckboxJSXProps, the s-checkbox tag, the 'checkbox' context literal, and Choice's description of "(checkboxes)" as a selection mode. The PreactCheckboxProps / PreactCheckboxElement declarations still carry checkbox wording on their other members (checked, defaultChecked, details, error, required) — those also leak onto Switch, but they're a larger rewording question than a find/replace, so they're out of scope here.

Change

8 sentence-level replacements — identical in the .d.ts, the flattened JSON descriptions, and the escaped interface blocks, so one pass covers all three. Each is asserted to appear an exact expected number of times in the source.

Independent of #4662 (different lines), so the two can merge in either order. Generated JSON was patched textually rather than regenerated, as in #4662; all files re-parse as valid JSON and the diff is symmetric (+63/-63).

Backports: #4668 (2026-04), #4669 (2026-01), #4670 (2025-10).

Refs shop/issues-learn#2959

🤖 Generated with Claude Code

@sordaz00
sordaz00 requested a review from a team as a code owner September 1, 2026 14:03
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

We detected some changes in packages/*/package.json or packages/*/src, and there are no updates in the .changeset directory. If the changes are user-facing and should cause a version bump, run yarn changeset to track your changes and include them in the next release CHANGELOG. If you are making simple updates to repo configuration, examples, or documentation, you do not need to add a changeset.

@github-actions github-actions Bot added the needs-rc-port PR against a stable branch awaiting forward-port to the current RC label Sep 1, 2026
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

This PR targets a stable release branch (2026-07). Once merged, the change typically also needs to be forward-ported to 2026-10-rc so it ships in the next release.

When you open the forward-port PR, include a line like this in its body so the needs-rc-port label gets removed automatically when that PR merges:

Forward-port of #4667

Accepted formats (comma-separated for multiple):

  • #4667
  • GH-4667
  • 4667
  • https://github.com/Shopify/ui-extensions/pull/4667

If a forward-port isn't needed (e.g., the change is stable-only), you can remove the needs-rc-port label manually.

`BaseSelectableProps` (`disabled`, `value`) and `BaseCheckableProps`
(`label`, `name`) described themselves as a checkbox. Both are shared
base interfaces, so the copy is inherited by Choice and Option (via
`BaseOptionProps`) and by Switch, where it reads incorrectly.

Replace "checkbox" with "control" throughout. State verbs follow each
interface's own family vocabulary: `BaseSelectableProps` is the shared
parent of both families and uses "selected", matching its name and the
Option/Choice wording; `BaseCheckableProps` covers only Checkbox and
Switch and keeps "checked", matching the existing `checked` and
`defaultChecked` descriptions on that interface.

Completes the checkbox-terminology cleanup started in #4662 - every
remaining "checkbox" mention in components.d.ts is now genuinely
checkbox-specific.

Refs shop/issues-learn#2959

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@sordaz00
sordaz00 force-pushed the so/fix-control-wording-2026-07 branch from 24e6965 to 9d84871 Compare September 1, 2026 14:06
sordaz00 added a commit that referenced this pull request Sep 1, 2026
Backport of #4667 to 2026-04.

`BaseSelectableProps` (`disabled`, `value`) and `BaseCheckableProps`
(`label`, `name`) described themselves as a checkbox. Both are shared
base interfaces, so the copy is inherited by Choice and Option (via
`BaseOptionProps`) and by Switch, where it reads incorrectly.

Replace "checkbox" with "control". State verbs follow each interface's
own family vocabulary: `BaseSelectableProps` uses "selected", matching
its name and the Option/Choice wording; `BaseCheckableProps` covers only
Checkbox and Switch and keeps "checked".

Refs shop/issues-learn#2959

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@sordaz00 sordaz00 self-assigned this Sep 2, 2026
@sordaz00
sordaz00 merged commit 350dad8 into 2026-07 Sep 2, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-rc-port PR against a stable branch awaiting forward-port to the current RC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants