mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
Adds a Notion-style pill toggle at the top of the always-visible sidebar that switches between Workspaces (current tree) and Sessions (flat live-updating list of agents across the daemon). Sessions are sorted by createdAt desc (stable, tie-broken by id) and filtered to agents whose cwd maps to an opened workspace; clicking a row focuses the matching workspace tab via prepareWorkspaceTab + navigateToPreparedWorkspaceTab. The existing "Sessions" sidebar row is renamed to "History" (same destination). Lives in its own module at packages/app/src/sidebar-sessions/ with the sidebar shell pieces extracted to packages/app/src/components/sidebar/. Render performance is treated as first-class: parent subscribes to an ordered id list with shallow array equality (useAggregatedAgentIds), each row uses a per-agent shallow Zustand selector, the inactive view is unmounted on toggle, and the filter dropdown subscription is gated to Sessions mode. Filter state resets on host change. Agents whose cwd doesn't map to an opened workspace are hidden from both list and dropdown options. Includes a Playwright user-journey spec and unit/integration tests for the new ids hook, slice selector, render boundaries, navigation, filtering, and the sidebar-sessions controller.