[COMMAND MENU ITEMS] Disable hide label toggle for items with no short label (#19464)

<img width="824" height="1140" alt="CleanShot 2026-04-08 at 18 08 31@2x"
src="https://github.com/user-attachments/assets/67989cd7-ac0f-4c28-b128-6db50abecc88"
/>
This commit is contained in:
Raphaël Bosi
2026-04-08 18:32:01 +02:00
committed by GitHub
parent 7aed9291cd
commit 2267c56f15
@@ -37,6 +37,7 @@ export const CommandMenuItemOptionsDropdown = ({
const normalizedServerShortLabel = serverShortLabel ?? null;
const normalizedShortLabel = shortLabel ?? null;
const hasNoShortLabel = normalizedServerShortLabel === null;
const isLabelHidden =
normalizedShortLabel === null && isDefined(normalizedServerShortLabel);
const hasShortLabelOverride =
@@ -66,9 +67,10 @@ export const CommandMenuItemOptionsDropdown = ({
<MenuItemToggle
LeftIcon={IconTag}
text={t`Hide label`}
toggled={isLabelHidden}
toggled={isLabelHidden || hasNoShortLabel}
onToggleChange={handleToggleHideLabel}
toggleSize="small"
disabled={hasNoShortLabel}
/>
<MenuItem
LeftIcon={IconRefresh}