feat(desktop): replace sidebar activity strip with port/agent chips and bulk-close hover cards

Merged
SA
4mo ago
+745-458

What

Replaces the per-workspace sidebar activity strip (the hover-morph row with staggered port badges) with compact chips on a slim activity line under each workspace row, adding a first-class way to bulk-close all ports (and stop all agents) for a workspace.

  • Ports chip: radio tower + count, old count-pill aesthetic (bg-muted/60). Hovering the chip cross-fades the count to an × in place (constant width); clicking kills every port via the existing killPorts and toasts "Closed N ports" (no undo — the processes are gone).
  • Agents chip: avatar of the most-relevant agent (highest STATUS_PRIORITY, newest on ties) + total count; renders only with 2+ running agents (existing noise rule). Clicking the × stops all agents via a new bulk killAgents (Promise.allSettled over the existing terminal.killSession mutation).
  • Hover cards (Radix HoverCard, 150 ms): list every port (label · localhost:port, click-to-open respecting portOpenAction, per-row ×) or agent (icon, label, status, per-row ×), with a plain-styled "Close all ports" / "Stop all agents" footer. Rows are layout-shift-free (visibility swaps, no display toggles).
  • Hover-card mutual exclusion: chips hold a ref-counted suppression on DashboardSidebarHoverProvider while hovered, so the workspace hover card yields to the chip card and returns instantly afterward.

Refactors / removals

  • usePortOpenActions extracted from DashboardSidebarPortBadge and shared with the new hover rows (no behavior change to the bottom-panel badge).
  • useDashboardSidebarWorkspaceRunningAgents + useDashboardSidebarAgentKill moved under the new DashboardSidebarWorkspaceChips; kill hook gains killAgents.
  • Deleted DashboardSidebarWorkspaceDetails (morph strip, DashboardSidebarWorkspaceAgentBadge, DashboardSidebarWorkspaceDetailsAction, stagger constants), the details-expanded @custom-variant in globals.css, and the group/item / data-active scaffolding.
  • Diff-stats ↔ hover-actions swap on the row now uses visibility instead of display, so the row is layout-stable on hover.

Flags

Unchanged: ports chip behind inline-workspace-ports, agents chip behind workspace-agents-row; flag-off still shows the bottom PORTS panel. Store teardown docs updated to point at the chip components.

Testing

  • bun run lint and apps/desktop typecheck clean; no remaining references to the deleted strip/variant.
  • Manually iterated in the dev app across several design rounds (chip legibility, single-avatar rule, no layout shift on row or hover-card rows, hover-card mutual exclusion, toast on bulk close).

https://claude.ai/code/session_01HGmkhuu5WVFn83PhDC7Yoz


Summary by cubic

Replace the sidebar activity strip with compact ports/agents chips under each workspace row. Adds bulk-close actions and hover cards for quick per-item actions; flags remain the same and the bottom PORTS panel is unchanged.

  • New Features

    • Ports chip: radio tower + count; hover swaps count to ×; click closes all ports; hover card lists ports with per-row close and a “Close all ports” footer.
    • Agents chip: shows the most relevant agent + count when 2+ are running; click stops all agents; hover card lists agents with status and per-row stop.
    • Chip hover suppresses the workspace hover card to avoid overlap; bulk actions show success toasts.
  • Refactors

    • Extracted port open logic into usePortOpenActions and reused in the sidebar port badge.
    • Added bulk killAgents to the agent kill hook.
    • Removed the old morph strip and related components/styles, including the details-expanded CSS variant.
    • Made row hover UI layout-stable by switching to visibility (diff stats vs. hover actions) and updated the hover overlay to honor suppression.

Summary by CodeRabbit

  • New Features

    • Added workspace sidebar chips showing active ports and running agents.
    • Added hover details for individual ports and agents, including quick open, close, and stop actions.
    • Added controls to close all active ports or stop all running agents with progress feedback and notifications.
  • Bug Fixes

    • Improved sidebar hover behavior to prevent hover cards from closing during chip interactions.
    • Refined visibility behavior for workspace actions and diff statistics during hover and focus.