Add drag-to-reorder for sidebar Workspaces #39
Loading…
Reference in a new issue
No description provided.
Delete branch "workspaces-drag-reorder"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
The sidebar's Workspaces can now be dragged up and down to reorder them, and the order persists.
How
The
workspacestable already carried an indexedsort_ordercolumn andlist_workspacesalready ordered by it — this just wires the UI up to set it.reorder_workspacescommand rewrites each row'ssort_orderto its position in the supplied id list, atomically (write_orderhelper + unit test).Reorder.Group/Reorder.Item(no new dependency;motionwas already in use).onReorderupdates the store live during the drag;onDragEndpersists the final order. The store applies the new order optimistically and falls back to a server refresh if the write fails. The "New workspace" action sits inside the group but isn't aReorder.Item, so it stays pinned at the bottom and isn't draggable.Testing
tsc, Biome,cargo check, and the workspace unit tests (incl. the newreorder_rewrites_sort_order) all pass. Verified visually viamake dev: drag reorders, order survives a restart, plain clicks still navigate, and the right-click context menu still works.