feat(floorplan-editor): hand tool joins the exclusive tool group, sits first in toolbar

Two related changes from the latest feedback:

1) Hand is now the FIRST button in the toolbar (left of the
   'Modalita disegno' label), matching where users typically
   look for a pan affordance in painting / mapping editors.

2) The hand and the brush buttons form one exclusive tool
   group: picking any brush (SET / UNSET / UP / DOWN / DOOR)
   - or select-all / square-select - clears pan mode. No more
   'I clicked SET but the canvas keeps panning'. Same goes
   the other way: clicking the hand stays sticky, and while
   it's active the brush highlights are visually de-selected
   even though state.brush.action still holds the last brush
   (so the user gets it back the moment they pick a brush
   again).

Implementation: replaced the toolbar's onTogglePanMode prop
with an imperative setPanMode(next: boolean) =>. Every other
tool's onClick calls exitPan() first; the hand calls
setPanMode(!panMode) directly. data-active and the border
highlight on the brush + square-select buttons now require
!panMode so the visual state mirrors the gesture state.

No reducer changes - panMode stays a canvas-level UI flag.
This commit is contained in:
simoleo89
2026-05-24 22:04:48 +02:00
committed by simoleo89
parent 3aa06d4dc4
commit e60d6e2df8
2 changed files with 63 additions and 30 deletions
@@ -234,7 +234,7 @@ export const FloorplanEditorView: FC = () =>
onUndo={ undo }
onRedo={ redo }
panMode={ panMode }
onTogglePanMode={ () => setPanMode(v => !v) }
setPanMode={ setPanMode }
/>
<FloorplanOptionsPanel state={ state } dispatch={ dispatch } />
<Flex gap={ 2 } className="flex-1 min-h-0">