From bd912a8fd4b7fcd20ae0067ad72e00bf5ca8c22e Mon Sep 17 00:00:00 2001 From: bbassie <17990055+bbassie@users.noreply.github.com> Date: Sat, 21 Nov 2026 19:30:18 +0000 Subject: [PATCH] Respect disabled on the main dropdown button action A plugin action can be disabled, and it becomes the main button when the user has no restart permission. Only the main button is disabled so the menu stays usable. Co-Authored-By: Claude Opus 5.5 --- packages/web_ui/src/components/VariableDropdownButton.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/web_ui/src/components/VariableDropdownButton.tsx b/packages/web_ui/src/components/VariableDropdownButton.tsx index 3f5f4fb5..ccbef653 100644 --- a/packages/web_ui/src/components/VariableDropdownButton.tsx +++ b/packages/web_ui/src/components/VariableDropdownButton.tsx @@ -15,19 +15,20 @@ export default function VariableDropdownButton(props: VariableDropdownButtonProp return <>; } + const mainDisabled = props.disabled || mainAction.disabled; const buttonProps: DropdownButtonProps = { ...props, danger: mainAction.danger, onClick: (event) => { event.stopPropagation(); - if (mainAction.onClick) { + if (!mainDisabled && mainAction.onClick) { mainAction.onClick(); } }, }; return menuActions.length === 0 - ? : e.domEvent.stopPropagation() }} buttonsRender={([left, right]) => [ - left, React.cloneElement(right as any, { onClick: (e: any) => e.stopPropagation() }), + React.cloneElement(left as any, { disabled: mainDisabled }), + React.cloneElement(right as any, { onClick: (e: any) => e.stopPropagation() }), ]} > {mainAction.label}