Uh oh!
There was an error while loading. Please reload this page.
fix(components): retire ToggleGroupItem.icon, honor item-level disabled - #4651
Merged
Conversation
`ToggleGroupItem` declared `icon?` and `disabled?` while the `toggle-group` renderer read neither, so both keys were silently dropped at render time. Settled in opposite directions by measurement: - `icon` is retired from the interface, the Zod mirror, the schema-catalog entry and the docs page. The single catalog entry was the only site in the repo authoring it; no code read it. - `disabled` is forwarded to the underlying toggle item, matching the item-level `disabled` that `tabs`, `select`, `dropdown-menu`, `menubar` and `context-menu` already honor. Radix supports it natively, so the synced `ui/toggle-group.tsx` primitive is untouched. Fixes#4632 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnQd8iMMUwXQEV1crFmQiQ
The latest updates on your projects. Learn more about Vercel for GitHub. |
This was referenced Aug 14, 2026
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
yinlianghui
marked this pull request as ready for review
August 14, 2026 16:11
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes#4632
ToggleGroupItemdeclaredicon?: stringanddisabled?: booleanwhile thetoggle-grouprenderer read neither — it mapped items to value + aria-label + label and dropped the rest. Premise re-verified againstorigin/main(a99233fff): both keys declared atpackages/types/src/disclosure.ts, neither read atpackages/components/src/renderers/disclosure/toggle-group.tsx. The card's mechanism hypothesis held in full, anddisabledwas confirmed unread as the card claimed.The measurement (the ruling asked for it first)
Enforce-or-remove, decided per key by measured pull rather than by symmetry:
iconcomponents-disclosure-toggle-group/with-labels.jsondisabledicon— retired. Swept the whole repo (catalog schemas, docs, example apps, application code) plus the siblingobjectstackcheckout. The only site authoring it was that one catalog entry; the only other mention was the docs page's schema block, which is a mirror of the declaration, not a consumer. The loneobjectstackhit istoggle-groupas a form-field widget name in a spec test — a different surface, not an item list. Zero pull, so under declared=enforced it is removed rather than speculatively implemented.disabled— wired. Item-leveldisabledis established live convention in this codebase:tabs,select,dropdown-menu,menubarandcontext-menuall forward it.toggle-groupwas the lone outlier, so the convention itself is the consumer. The underlying Radix item supportsdisablednatively, so forwarding one prop is the whole change — the synced no-touchui/toggle-group.tsx(AGENTS.md 构建一个 **Live Playground (实时演练场)** (用于展示引擎能力) #7) is untouched.Surfaces changed
packages/types/src/disclosure.ts—iconremoved;disabledkept and documented as forwarded.packages/types/src/zod/disclosure.zod.ts— not named in the card or the dispatch;ToggleGroupItemSchemadeclaredicontoo. A retirement that left this standing would have left half the contract lying, so it is included.packages/components/src/renderers/disclosure/toggle-group.tsx— forwardsdisabledper item.examples/schema-catalog/.../with-labels.json—iconkeys dropped; one item now demonstratesdisabled, so the corpus teaches a key that works. Contents-only edit, no index regeneration (per fix(examples,scripts): regenerating the schema catalog stops discarding curated metadata #4637's own model).content/docs/components/disclosure/toggle-group.mdx— fourth surface, beyond the claimed set: its schema block taughticon?: string. Leaving it would defeat the card's own point (the corpus teaching a dead key), and AGENTS.md Add automated testing infrastructure and CI/CD workflows #2 is docs-driven. Also correctedlabel?tolabelin the same block to match the interface. The block's separatetype:/selectionTypeerror is left alone and filed instead (below).Tests, all at
de398f5d6Full verification ran after the final commit, tree clean.
pnpm exec vitest run packages/types/ packages/components/ examples/schema-catalog/— 171 files / 3100 tests passed.pnpm --filter @object-ui/types type-checkandpnpm --filter @object-ui/components type-check— clean (the latter afterpnpm --filter '@object-ui/components^...' build; a fresh worktree fails it on unresolved workspace deps, unrelated to this change).check-changeset-presence/check-changeset-no-major/check-control-bytes/check-doc-links— all green. ESLint on the changed files: 0 errors.Reverse verification, direction predicted before each run:
disabledforward ⇒ predicted 2 red / 2 green in the behavior pin (the two forwarding tests fail; "no item declares disabled" and the label test do not depend on the fix). Observed exactly that, with the dump showing the button rendered withoutdisabled.iconto both declaration surfaces ⇒ predicted the two Zod pins red and the@ts-expect-errorpin green under vitest, which cannot typecheck. Observed 2 failed / 4 passed; undertscthe same state iserror TS2578: Unused '@ts-expect-error' directive— so the compile-time pin is real enforcement (this package type-checks its tests viatsconfig.test.json).iconin a@object-ui/componentstest against the rebuilt@object-ui/typesd.ts ⇒error TS2353: Object literal may only specify known properties, and 'icon' does not exist in type 'ToggleGroupItem'. The retirement reaches consumers, and that verdict came from the rebuilt declaration, not a cached one.Each ablation was restored with
git checkoutfrom the commit and confirmed byte-clean (git status --porcelainempty).Notes
minorfor both packages: breaking for TypeScript authors oficon, per this repo's version-alignment rule reservingmajorfor following@objectstack. Runtime behavior of an authorediconis unchanged — it rendered nothing before and renders nothing now; what changes is that the contract stops claiming otherwise. Authoreddisabledchanges from silently ignored to actually disabling that one item.AccordionItemin the same file declaresicon?anddisabled?and the accordion renderer reads neither — the identical defect one interface up.Generated by Claude Code