From 38c457943ac5fffb4bde2f1497421671c2f0c8d6 Mon Sep 17 00:00:00 2001 From: Hiren Kangad Date: Tue, 10 Mar 2026 04:27:01 +0530 Subject: [PATCH] fix(refboard): reduce distribute H/V min selection from 3 to 2 --- frontend/src/canvas/context-menu-items.ts | 4 ++-- frontend/src/canvas/shortcut-definitions.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/canvas/context-menu-items.ts b/frontend/src/canvas/context-menu-items.ts index 8bf231c..e424ed6 100644 --- a/frontend/src/canvas/context-menu-items.ts +++ b/frontend/src/canvas/context-menu-items.ts @@ -82,8 +82,8 @@ export function buildContextMenuItems(ctx: MenuContext): MenuItem[] { { label: 'Align Right', shortcut: 'Ctrl+\u2192', onClick: () => { ops.alignRight(selected); selection?.transformBox.update(selected); ctx.onChange(); }, disabled: !multiSel }, { label: 'Align Top', shortcut: 'Ctrl+\u2191', onClick: () => { ops.alignTop(selected); selection?.transformBox.update(selected); ctx.onChange(); }, disabled: !multiSel }, { label: 'Align Bottom', shortcut: 'Ctrl+\u2193', onClick: () => { ops.alignBottom(selected); selection?.transformBox.update(selected); ctx.onChange(); }, disabled: !multiSel }, - { label: 'Distribute H', shortcut: '', onClick: () => { ops.distributeHorizontal(selected); selection?.transformBox.update(selected); ctx.onChange(); }, disabled: selected.length < 3 }, - { label: 'Distribute V', shortcut: '', onClick: () => { ops.distributeVertical(selected); selection?.transformBox.update(selected); ctx.onChange(); }, disabled: selected.length < 3 }, + { label: 'Distribute H', shortcut: '', onClick: () => { ops.distributeHorizontal(selected); selection?.transformBox.update(selected); ctx.onChange(); }, disabled: !multiSel }, + { label: 'Distribute V', shortcut: '', onClick: () => { ops.distributeVertical(selected); selection?.transformBox.update(selected); ctx.onChange(); }, disabled: !multiSel }, { label: '', shortcut: '', onClick: () => {}, divider: true }, // -- Layer ordering -- diff --git a/frontend/src/canvas/shortcut-definitions.ts b/frontend/src/canvas/shortcut-definitions.ts index ef78638..2b5d7b4 100644 --- a/frontend/src/canvas/shortcut-definitions.ts +++ b/frontend/src/canvas/shortcut-definitions.ts @@ -143,12 +143,12 @@ export const shortcuts: ShortcutDef[] = [ { id: 'distribute-h', keys: { key: 'arrowup', ctrl: true, alt: true, shift: true }, - category: 'alignment', description: 'Distribute horizontal', needsSelection: true, minSelection: 3, + category: 'alignment', description: 'Distribute horizontal', needsSelection: true, minSelection: 2, handler: (ctx) => _opUpdate(ctx, ops.distributeHorizontal), }, { id: 'distribute-v', keys: { key: 'arrowdown', ctrl: true, alt: true, shift: true }, - category: 'alignment', description: 'Distribute vertical', needsSelection: true, minSelection: 3, + category: 'alignment', description: 'Distribute vertical', needsSelection: true, minSelection: 2, handler: (ctx) => _opUpdate(ctx, ops.distributeVertical), },