feat(desktop): keep PR status visible in the sidebar while an agent works

DI
1mo ago
+106-3

What & why

Fixes #7635.

While an agent was working, the spinner replaced the whole workspace icon in the sidebar, so you could not see whether the workspace had a PR or what state it was in. The other agent statuses (needs input, ready for review, failed) already kept the PR icon and added a dot at the top right. Working now does the same when there is a PR.

  • A new resolveWorkspaceIconIndicators util decides what the icon shows:
    • Working, with a PR: the PR icon stays, with an amber working dot on it.
    • Working without a PR, or still being created: the spinner shows, as before.
    • Other statuses: unchanged.
  • The working dot pulses (animate-pulse, turned off by motion-reduce). The pulse is applied only in this icon, so the shared StatusIndicator and its other users do not change.
  • The expanded and collapsed sidebar share this component, so both are covered. There are no layout, tooltip, hover card, or string changes.

Related work: #7808 adds check badges at the bottom right of the same icon. The working dot stays at the top right, so they do not overlap, but both PRs edit the same few lines, so whichever merges second needs a small rebase.

Screenshots

A workspace whose PR (#8389) is merged, with an agent working in it. Cropped and zoomed in.

BeforeAfter
Expanded sidebarBefore: an amber spinner replaces the PR iconAfter: the purple merged-PR icon stays, with an amber dot at the top right
Collapsed sidebarBefore, collapsed: spinnerAfter, collapsed: PR icon with amber dot

The dot pulses in the app; a still image shows it at one point of the pulse.

How I tested it

  • The branch is based on main at a8c6da1c2 and merges cleanly with main at cc31d024c. On that merge, with the pinned Bun 1.4.2 (.bun-version): bun run lint passes with no diagnostics, bun run check:i18n leaves the catalogs unchanged, turbo typecheck --filter=@superset/desktop passes, the DashboardSidebar suite passes (192 tests, including 10 new ones for the util), and the full desktop suite passes (8284 tests, 1 skipped).
  • I ran the dev app and drove it over CDP, using a real workspace whose PR (#8389) was linked by the host, with agent status sent through the notifications hook:
    • Expanded sidebar, working with a PR: the PR icon stays, the amber dot pulses, and there is no spinner. The tooltip and hover card are unchanged.
    • Collapsed sidebar: the same.
    • Needs input shows the yellow pinging dot over the PR icon, Stop shows the static green dot, and starting again goes back to the amber pulse. Only the working case changed.
    • For the before shots, I put back main's DashboardSidebarWorkspaceIcon.tsx in the same app.

Checklist

  • PR title follows conventional commits (type(scope): subject)
  • bun run lint and bun run typecheck pass (CI fails on lint warnings too). Lint ran on the whole repo, and the type check ran for @superset/desktop, the only package this PR changes.
  • "Allow edits from maintainers" is checked on fork PRs

Summary by cubic

Keeps the sidebar workspace icon from hiding PR status while an agent works.

  • Workspaces with a PR keep the PR icon with a pulsing amber dot while working; workspaces without a PR, or still being created, keep the spinner.
  • The pulse is applied only in this icon and is disabled under reduced motion; expanded and collapsed sidebar states are both covered.

Summary by CodeRabbit

  • Bug Fixes
    • Workspace icons now show a spinner for pending creation and for workspaces that are working without a pull request. Status indicators remain visible where applicable, including when a pull request is present.
    • Working status indicators animate, with animation disabled when reduced motion is preferred.