You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(ui): add drag-and-drop sorting for agents in sidebar
Enable users to reorder agents in the navigation sidebar via drag-and-drop.
Order persists to localStorage and is maintained across sessions.
Features:
- Hold-and-drag (150ms) to reorder agents
- Quick click navigates normally
- Works in both collapsed and expanded sidebar states
- Visual feedback: opacity change during drag, cursor changes to grabbing
- Keyboard accessible via arrow keys
- Prevents unwanted navigation during drag with pointerEvents control
Technical implementation:
- Uses @dnd-kit for performant, accessible drag-and-drop
- Custom useAgentOrder hook manages localStorage persistence
- 150ms delay activation distinguishes clicks from drags
- 5px tolerance for small hand movements
- localStorage key: "spacebot:agent-order"
- New agents automatically appended to custom order
No backend changes required. Frontend-only feature.
Files modified:
- interface/package.json: Added @dnd-kit dependencies
- interface/bun.lock: Updated lock file
- interface/src/hooks/useAgentOrder.ts: New hook for order persistence
- interface/src/components/Sidebar.tsx: Integrated drag-and-drop
0 commit comments