feat: mobile selection UX and two-finger box rotation#8
Merged
RohitRajendran merged 9 commits intomainfrom Mar 25, 2026
Merged
Conversation
Add propertiesPanelOpen boolean to useToolStore (default false) with setPropertiesPanelOpen action; reset on clearSelection and setActiveTool. Add snapshotForUndo and updateElementSilent to useFloorplanStore to support single-checkpoint undo for gestures and revert-on-cancel for the mobile properties panel.
Detect the angle between two touch points and apply the delta to the selected box's rotation on each touchmove frame, snapped to 5° increments. A single snapshotForUndo checkpoint is taken at touchstart so the entire gesture undoes in one step. The properties panel is hidden during the gesture and restored on touchend. Also update mobile onSelect logic so first tap selects without opening the panel; second tap (or desktop) opens it.
On mobile (≤730px), selecting one element shows a compact action bar at the toolbar slot instead of immediately opening the properties panel. The bar provides Undo, Redo, Edit, and Delete actions. Tapping Edit opens the properties panel and switches the bar to a Cancel/Done mode. Cancel silently restores the element to its pre-edit snapshot; Done commits changes. The toolbar is hidden whenever the bar is visible.
Toolbar: hide via display:none (preserving keyboard shortcuts) whenever MobileSelectionBar is visible on mobile; add data-testid for targeting. PropertiesPanel: gate render on propertiesPanelOpen flag; hide the Delete button on mobile since it lives in MobileSelectionBar instead.
New tests cover: mobile selection bar visibility, toolbar hide/show, Edit→Cancel/Done flow with change revert, Delete, Undo/Redo in bar, two-finger twist rotation, single-step undo for rotation gesture, and pinch-zoom unaffected when no box is selected. Optimizations: replace waitForTimeout(100) with expect.poll, extract shared box-draw+select beforeEach in Box drawing describe, nest iPhone SE viewport tests under a shared beforeEach, merge short 2-test groups into single tests (tool switching, canvas shortcuts, measure escape, arrow keys), and extract drawTwoBoxesAndMarqueeSelect helper.
Konva can fire dragend without an attached native event on touch, making e.evt undefined. Use optional chaining (e.evt?.shiftKey) in all six call sites across WallElement, BoxElement, and DrawingCanvas.
✅ Deploy Preview for snapdraftfloorplans ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
e.evtundefined crash when dragging a wall endpoint on touchmobile-web-app-capablemeta tag alongside the deprecated Apple variantTest plan
npm run test:e2epasses (144 tests)