fix(spaces): make rail reorder & folders work on touch#121
Conversation
The space rail's folder/reorder feature was fully built but bound to gestures that mismatched mobile: the management menu (new folder, move in/out, leave) opened only on double-tap or right-click, so on Android folder creation was effectively unreachable, and long-press was consumed by drag instead of opening a menu. Re-bind to platform conventions, Discord-style: - New _RailDraggable: on touch, a long-press lifts the icon to drag (with haptic); a long-press released in place opens the management menu — the discoverable home for it on touch. Desktop keeps immediate click-drag. - Dropping a space onto another space now groups them into a new folder; reordering happens via the existing insertion gaps between tiles. - Menus open on long-press (touch) / right-click (desktop); double-tap dropped everywhere. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add HapticFeedback.mediumImpact() on drag start in _RailDraggableState (PR description promised "haptic on pickup" but it was not wired up) - Reduce the _moved detection threshold from 24 px to 8 px so a short drag that misses all drop targets no longer accidentally opens the context menu (8 px is above typical touch jitter ~4 px and well below any intentional reorder movement) - Add unit tests for createFolder, moveSpaceToFolder, and setSpaceOrder — all three are exercised by the new merge-on-drop behaviour and were previously untested https://claude.ai/code/session_01Adf1XcJE5kgwZNYmzz3XHF
Code Review — findings & fixes (commit 44b908b)All fixes were pushed directly to this branch. Findings ranked by severity: 🔴 HIGH — Missing haptic feedback on drag startFile: The PR description explicitly says "long-press lifts the icon to drag (with haptic on pickup)", but 🟡 MEDIUM —
|
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Summary
The space rail's folder/reorder feature was fully implemented (model, persistence, drag targets) but its gestures were bound in a way that broke it on mobile:
This re-binds the rail gestures to platform conventions, Discord-style.
What changed
_RailDraggablewidget (replaces the old_railDraggablehelper):LongPressDraggable— long-press lifts the icon to drag (with haptic on pickup). A long-press released in place without dragging opens the item's management menu at that point — the discoverable home for it on touch._DraggableSpaceand_FolderMemberTiletoStatelessWidget(the menu-anchor state now lives in_RailDraggable).Why
Reported: on Android you can't long-press spaces to reorder, move them into folders, or create folders. Root cause was gesture binding, not missing functionality — this restores all three on touch while keeping desktop behavior intact.
Reviewer notes
flutter analyze --no-fatal-infoson both changed files: No issues found.ListViewis worth a quick manual check on hardware before merge.Test plan
🤖 Generated with Claude Code