fix(admin): use control-generic wording for selectable prop docs - #4667
Conversation
|
We detected some changes in |
|
This PR targets a stable release branch ( When you open the forward-port PR, include a line like this in its body so the Accepted formats (comma-separated for multiple):
If a forward-port isn't needed (e.g., the change is stable-only), you can remove the |
`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>
24e6965 to
9d84871
Compare
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>
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:
BaseSelectablePropsBaseSelectablePropsBaseCheckablePropsBaseCheckablePropsPreactCheckboxProps/PreactCheckboxElementBaseSelectableProps→BaseOptionProps→ Choice/Option;BaseSelectableProps→BaseCheckableProps→ Switch;SwitchProps extends PreactCheckboxPropsandclass Switch extends PreactCheckboxElement.Wording
"checkbox" → "control" throughout. State verbs follow each interface's own family vocabulary, which is split in this file:
BaseOptionPropsfamily (Choice/Option) uses selected — 5 occurrences, 0 "checked"BaseCheckablePropsfamily (Checkbox/Switch) uses checked — 7 occurrences, 0 "selected"So
BaseSelectableProps, the shared parent of both, uses selected (matching its own name);BaseCheckablePropsand thePreactCheckbox*declarations, which cover only Checkbox and Switch, keep checked (matching thechecked/defaultCheckeddescriptions already on them). "control" also matchesui-api-design, the upstream source of truth.Mentions of "control is checked" remains, as
checkedis the actual property name, including on Switch.What's left
The remaining
checkboxmentions incomponents.d.tsare genuinely checkbox-specific:CheckboxProps,CheckboxJSXProps, thes-checkboxtag, the'checkbox'context literal, and Choice's description of "(checkboxes)" as a selection mode. ThePreactCheckboxProps/PreactCheckboxElementdeclarations 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