Skip to content

Commit 01d1300

Browse files
committed
refactor(components): read a member's declared disabled uncast for its 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>
1 parent c937d9c commit 01d1300

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎packages/components/src/renderers/action/action-group.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ const InlineActionButton: React.FC<{
128128
// `disabled` predicate, evaluated true. The group's `hostDisabled` and this
129129
// member's `loading` disable it without one. See `./disabled-reason`.
130130
const disabledReason = useDisabledReason(
131-
hasDeclaredVisibilityGate((action as any).disabled) && isDisabledPred,
131+
hasDeclaredVisibilityGate(action.disabled) && isDisabledPred,
132132
);
133133

134134
const Icon = resolveIcon(action.icon);
@@ -225,7 +225,7 @@ export const DropdownActionItem: React.FC<{
225225
// (objectui#11839), drawn the menu-item way: a visible second line that is the
226226
// item's description. See `./disabled-reason`.
227227
const disabledReason = useDisabledReason(
228-
hasDeclaredVisibilityGate((action as any).disabled) && isDisabledPred,
228+
hasDeclaredVisibilityGate(action.disabled) && isDisabledPred,
229229
);
230230
// Same declared-gate rule as `InlineActionButton` above — one action cannot be
231231
// hidden in one display mode and shown in the other (objectui#3812).

‎packages/components/src/renderers/action/action-menu.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export const ActionMenuItem: React.FC<{
113113
// drawn the menu-item way: a visible second line that is the item's
114114
// description. See `./disabled-reason`.
115115
const disabledReason = useDisabledReason(
116-
hasDeclaredVisibilityGate((action as any).disabled) && isDisabledPred,
116+
hasDeclaredVisibilityGate(action.disabled) && isDisabledPred,
117117
);
118118

119119
const iconElement = useMemo(() => {

0 commit comments

Comments
 (0)