mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-24 10:12:44 +00:00
Stops reinventing UX the workspace tree already solved. Five behavior-preserving extractions plus a few wires. Project ordering parity: Sessions consumes the canonical project list from useSidebarWorkspaces List instead of computing first-occurrence order from agents. The workspace tree's compareWorkspaceStructureProjects + persisted manual order via useSidebarOrderStore is the single source of truth for both views. Single non-git workspace projects flatten (no header, no chevron, rows render top-level) via the existing isSidebarProjectFlat tened gate from sidebar-project-row-model. Multi-workspace non-git projects and git projects collapse normally. Drag and drop parity: New SidebarProjectsDraggableList wraps the existing DraggableList, useDragHandle, useLongPressDragInteraction (extracted to its own file for sharing), and persists via setProjectOrder + the existing hasVisibleOrderChanged / mergeWithRemainder helpers. Both the workspace tree and grouped Sessions consume it. Workspace tree behavior unchanged; sessions's grouped view is now structured as a NestableScrollContainer / ScrollView around per-project sections. Project trailing actions parity: New SidebarProjectTrailingActions owns the project kebab (settings + remove), optional new-worktree button, and shortcut hint. Workspace tree uses it with the new-worktree button enabled; grouped Sessions uses it with kebab only. Per-agent kebab: New SidebarSessionRowKebabMenu reuses useArchiveAgent for archive, mirrors handleCloseAgentTab semantics for close, pulls the close menu entry from buildWorkspaceTabMenuEntries, and matches the workspace row kebab visibility (hover or touch). No fork. New session button: Plus button in the Sessions header reuses useOpenProjectPicker and buildHostNewWorkspaceRoute. Adds a label-only `title` query arg so the destination screen reads "New session" instead of "New workspace" when entered from this button. Tests cover ordering, flatten/collapse, drag-end persistence, kebab visibility/items, and the new-session route. Render-boundary tests extended for the section structure.