feat(desktop): badge-style ports icon, ports on the workspace title line

Merged
AV
1mo ago
+484-233

What & why

The ports indicators now share one icon: a radio tower with the port count in a small round badge at its top-right corner (the style the cloud rows already used).

  • Shared icon. PortsCountIcon (in _dashboard/components/) is used by the top-of-sidebar ports indicator (PortsDropdown), cloud rows, and workspace rows. Workspace rows use a smaller size (12px tower, 10px badge). The count caps at 9+.
  • Ports on the title line. On workspace rows, the ports icon moves from the line under the title to the far right of the title line, so a row with ports no longer takes a second line. The line under the title now holds only the agents chip. A wrapper stops the chip's pointer, click, and key events so the chip and its hover card do not start a drag or activate the row. The icon sits at the far right so it does not shift when the row's hover-only delete button appears.
  • Safe triangle for the ports hover cards. useHoverCardSafeTriangle keeps the Radix hover card open while the pointer moves from the chip toward the card, inside the triangle between the leave point and the card's near edge, for up to 1 s. Both workspace-row and cloud-row ports cards use it. The point-in-triangle math moves out of DashboardSidebarHoverProvider into utils/isPointInsideCardCone; the provider's behaviour is unchanged.

How I tested it

  • Dev app over CDP, screenshots of the header indicator, a workspace row, and a cloud row.
  • Safe triangle, live: hover the chip, move diagonally toward the card's lower half, pause 400 ms inside the triangle (longer than the 120 ms close delay). With the hook the card stays open, then closes once the pointer leaves the triangle. With the hook bypassed, the same script sees the card close during the pause.
  • bun test on DashboardSidebar: 184 pass, including 2 new tests for useHoverCardSafeTriangle. The chips strip tests lost their ports cases since ports left that strip.
  • biome check clean. The local desktop typecheck fails only on Better Auth plugin types from a local install split; no errors point at changed files. CI typecheck is the real check.

Checklist

  • PR title follows conventional commits (type(scope): subject)
  • bun run lint and bun run typecheck pass (CI fails on lint warnings too)
  • "Allow edits from maintainers" is checked on fork PRs

Summary by CodeRabbit

  • New Features
    • Workspace rows show port indicators when inline ports are enabled and ports are available.
    • Port counts use a compact icon, with counts above 9 shown as 9+.
  • Bug Fixes
    • Hover cards are less likely to close while moving the pointer from a port indicator toward the card.
    • Interacting with port controls and their hover-card content no longer triggers workspace-row actions such as dragging or activation.