Repository navigation
fix(components): a predicate-disabled action:* control says why it is unavailable (objectui#11839) - #11867
Merged
objectstack-fleet[bot] merged 5 commits intoOct 8, 2026
Conversation
… unavailable (objectui#11839) The four action renderers (action:button, action:icon, action:group, action:menu) drew a control greyed out by its declared `disabled` predicate with no reason. They now give the reason objectui#11811 gave the record header, the section bar and DeclaredActionsBar, with the same key (`actions.notAvailableForRecord`): - a button (action:button, action:icon, action:group inline) gets a focusable wrapper span as the tooltip trigger and an sr-only description that the button and the span both point at; - a menu item (action:menu, action:group dropdown) shows the reason as a visible second line that is its description, its name staying the label. Only the declared `disabled` predicate, evaluated true, earns the reason. The host's forwarded `disabled`, an action in flight and the legacy `enabled` leg disable the control without one. One module-private helper, `renderers/action/disabled-reason.tsx`, serves the four renderers; it is not exported from the package entry. Claude-Session: https://claude.ai/code/session_01CGZy1BGCjdN5cXqL9cnvB8 Co-authored-by: Claude <noreply@anthropic.com>
…ed reason (objectui#11839) Claude-Session: https://claude.ai/code/session_01CGZy1BGCjdN5cXqL9cnvB8 Co-authored-by: Claude <noreply@anthropic.com>
… own props (objectui#11839) The pass-through's return type cannot be indexed by an `aria-*` key, so the two button renderers read the authored description off `rest` instead. Claude-Session: https://claude.ai/code/session_01CGZy1BGCjdN5cXqL9cnvB8 Co-authored-by: Claude <noreply@anthropic.com>
…jectui#11839) A menu item greyed out by its declared `disabled` now shows the reason as a second line and names itself by its label element, so the placement pin reads each item's name, and pins the reason as the disabled member's description. Claude-Session: https://claude.ai/code/session_01CGZy1BGCjdN5cXqL9cnvB8 Co-authored-by: Claude <noreply@anthropic.com>
…s reason (objectui#11839) `UIActionSchema` declares `disabled`, so the reason's verdict reads it without the `any` cast the older lines beside it still carry. Claude-Session: https://claude.ai/code/session_01CGZy1BGCjdN5cXqL9cnvB8 Co-authored-by: Claude <noreply@anthropic.com>
Contributor
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
This was referenced Oct 8, 2026
objectstack-fleet
Bot
deleted the
claude/issue-11839-action-disabled-reason
branch
October 8, 2026 03:12
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 free
to 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 #11839
Clause-②: no
The four
action:*renderers in@object-ui/componentsdrew a control greyed out by its declareddisabledpredicate with no reason. They now give the reason objectui#11811 shipped for the record header, the section bar andDeclaredActionsBar: the generic "Not available for this record", from the same key,actions.notAvailableForRecord. Before, the control carried no tooltip, notitleand noaria-describedby.What changed
action:button,action:icon, and anaction:groupmember in inline mode (which also covers the membersaction:bardraws). The button sits in a focusable wrapper span, which is the tooltip trigger, the same shape as objectui#11811's. The span takes the hover, andtabIndex={0}lets a keyboard user focus it, which opens the tooltip too. The button and the span both pointaria-describedbyat ansr-onlycopy of the reason. A natively disabled button fires no pointer or focus events, and the Button primitive addsdisabled:pointer-events-none, so a tooltip on the button itself never opens.action:menuitem (includingaction:bar's overflow) and anaction:groupmember in dropdown mode. The reason is a visible second line under the label, and that line is the item'saria-describedby. Its name stays the label, througharia-labelledby. This is objectui#11811'spage:headeroverflow shape.renderers/action/disabled-reason.tsx, shared by the four renderers. It is not exported from the package entry. Measured on the build of this branch:dist/index.d.tsreaches 101 declaration files through its relative imports and exports, andrenderers/action/disabled-reason.d.tsis not one of them. The positive controlsvisibility-gate.d.tsandresolve-icon.d.tsare reached. The helper's names appear in no other built declaration file.containers.tsx, app-shell and plugin-detail keep their own copies; sharing one across packages would need an export..changeset/11839-action-disabled-reason.md, apatchon@object-ui/components. No export, prop, type member or language-pack key is added.Which
disabledearns the reasonOnly the declared
disabledpredicate, evaluated true. Each renderer computes it beside its existing gate ashasDeclaredVisibilityGate(disabled) && isDisabledPred. Three things still disable a control without a reason:disabled(hostDisabled, for example a disabled group's members, or a disabledaction:menutrigger);loading), which already shows a spinner;enabledleg. Measured on the three objectui#11811 surfaces: none of them readsenabled.page:header'sresolveDisabledtakesaction.disabledonly,QuickActionButtonreads onlydisabled(its comment says "There is no legacyenabledleg on this surface"), andDeclaredActionButtonreads onlyaction.disabled. So there anenabled: falseaction is not even disabled. Here the four renderers keepenabledas a deprecated, non-spec fallback that still disables. I followed objectui#11811's rule: the reason follows the spec keydisabledonly, and anenabled: falsecontrol stays disabled with no reason. A pin per renderer says so.action:iconhas no visible label. Its name stays itsaria-label, and the reason is added as its description. Its own label tooltip cannot open while it is disabled, because the trigger is the disabled button. The wrapper's tooltip therefore shows the label above the reason. An authoredaria-describedbyonaction:buttonoraction:icon(which reaches the DOM through the pass-through) is kept, and the reason's id is appended after it.Real-browser reading (Chromium,
/opt/pw-browsers/chromium)The harness was a throwaway Vite page in
apps/console, never committed. It renderedaction:bar(membersaction:button,action:iconandaction:menu), plusaction:groupinline and dropdown, over a row withdone: false, against the gate{ dialect: 'cel', source: 'has(record.done) && record.done != true' }.59ce048)0866036; the later commits change no rendered byte for these mounts)action:buttondiv[role=toolbar]; hover tooltip none; Tab never reaches itspan[data-disabled-reason]; hover tooltip the reason; Tab lands on the span, tooltip the reasonaction:iconaction:groupinline memberdiv; no tooltip; Tab never reaches itaction:buttonafteraction:menuitem (action:baroverflow)data-disabled; text "Archive later"; description nonedata-disabled; text "Archive later" with the reason under it; description the reason; name "Archive later"action:groupdropdown memberdata-disabled; text "Dropdown archive"; description noneWhy the menu items get no tooltip, also measured in Chromium: the hit target at a disabled item's centre is
div[role=menu](data-[disabled]:pointer-events-noneon the item primitive). Four ArrowDown presses never focus the disabled item: the group dropdown's roving focus stays on "View", and the bar overflow whose only other item is disabled stays on the menu. So a tooltip there would be unreachable by pointer and by keyboard. The visible line plus the description is the equivalent. The card's "tooltip on hover and focus" therefore reads as "the reason is visible and announced" on menu items.The same code is what the showcase's two
disabledspecimens would exercise, but neither reaches these renderers. Bothshowcase_archive_taskandshowcase_zoo_disabled_gatedeclarelocations: ['record_header', 'record_section'], whichpage:headerandrecord:quick_actionsdraw (objectui#11811 measured this for the Task page). So the reading above uses the four renderers directly, mounted the wayaction:barmounts them.Tests (head
01d1300)__tests__/action-disabled-reason-11839.test.tsx, 32 tests, nothing stubbed (the real renderers, Radix tooltip and menu, and the zh pack):action:button,action:iconandaction:groupinline: the disabled button is described by the reason; hover opensrole=tooltipwith it; Tab lands on the trigger, which is described by the reason and opens the tooltip. Controls: the predicate does not hold; an action in flight (pending handler, spinner showing); the host's forwardeddisabled; the legacyenabled: false;action:menuitem and theaction:groupdropdown member: the item isdata-disabled, named by its label, and described by a visible reason line. Controls: the predicate does not hold; the legacyenabled: false;action:menutrigger gives no reason; theaction:icontooltip carries the label and the reason; an authoredaria-describedbyis kept beside the reason; the zh pack (对此记录不可用) onaction:buttonand on anaction:menuitem.action-bar-member-placement-10345.test.tsx. ItsopenMenuLabelsread each item'stextContent, and a disabled item's text is now its label plus the reason. It now reads the item's name (thearia-labelledbyelement when there is one). The "a disabled menu-placed member is a disabled menu item" row also pins the reason as the item's description.vitest run packages/components/at01d1300:Test Files 367 passed | 1 skipped (368),Tests 3761 passed | 24 skipped (3785).currentUserCanx2,ObjectViewcreate and import predicates,RecordDetailView.userActionPredicates, plugin-detailDetailViewx2, consolerecord-block-record-reach,form-control-dom-leak-5632,widget-dom-leak-sweep), run withpackages/components/src/renderers/action/on the tree ofc937d9c:Test Files 42 passed (42),Tests 920 passed (920).pnpm --filter @object-ui/components type-check: exit 0 at the01d1300tree, on dists of the dependency closure rebuilt from this branch.--listFilesOnlyontsconfig.test.jsonlists both the new test and the helper.c937d9c) through objectstack'sscripts/ablation-replace.mjs, each with a trap restore. The suite is the new pin file plus the placement file, 53 tests. The tests import the renderers fromsrc, so no build sits between mutation and reading.if (!disabledByPredicate) return undefined;becomesreturn undefined;):Tests 16 failed | 37 passed (53). Red: every positive pin (15) and the placement row's description. Green: every control.if (!reason) return children;becomesreturn children;):Tests 12 failed | 41 passed (53). Red: description, hover and Tab on the three button sites, the icon tooltip, the authored description, and zh onaction:button. Green: the menu-item pins, zh on the menu item, the placement file, and every control.b493cd3b1d41) andgit diff HEADis empty.01d1300changes no byte of the helper.01d1300:check:control-bytes,check:test-path-roots,check:changeset-claims,check:pending-changeset-literals,check:action-forward-parity(it reads the four renderer files),check:i18n-keys(the helper's call site resolves against the en pack),check:new-line-citations(0 new), andcheck:unreferenced-sources(the helper is reached). The changeset scriptscheck-changeset-presence(1 released package, 1 changeset),check-changeset-no-major,check-changeset-fixedandcheck-changeset-overwritealso exit 0.eslinton the seven touched files: 0 errors. Each of the five pre-existing files has the same warning count as on59ce048. The new helper adds threereact-refresh/only-export-componentswarnings, for its hook and its two attribute helpers (warnings do not gate in this repo).Acceptance notes
disabledspecimen reaches the four renderers (see above). The showcase comment that says the Archive specimen exercises "action:button/group/icon/menu" is stale prose in objectstack. These renderers are reached by everyaction:bar, which draws the list toolbar inObjectViewandInterfaceListPageand the header bar inDetailView, and by authoredaction:*nodes. Noted only. Carrier: none.inline-flexspan, as in objectui#11811. Anaction:buttonwhose authorclassNamemakes it full width (for examplew-full) would shrink to its content while the predicate holds. No such use was found in this repo's sources or in objectstack's examples. Noted only. Carrier: none.(action as any).disabledcasts beside the new uncast reads inaction-group.tsxandaction-menu.tsxare no longer needed, becauseUIActionSchemadeclaresdisabled. They are left as they were. Polish only.disabledpredicate that faults (fail-soft) also greys the control out and now also shows the generic reason. This is the same note objectui#11811 made for its surfaces.The session behind this change is
https://claude.ai/code/session_01CGZy1BGCjdN5cXqL9cnvB8.Generated by Claude Code