feat(desktop): show the branch on local workspace rows

SV
12d ago
+77-1

What & why

A type: "local" workspace now has a name the user picks (#7485), and several local workspaces can share one checkout. The v2 sidebar showed only that name, so you could not see the branch of the checkout on the row. It was visible only in the hover card and in ⌘K.

This PR shows the branch as a muted mono suffix after the name on local rows:

  • The suffix is hidden when the branch is the same as the displayed name (case-insensitive), or when the branch is empty.
  • Worktree and session rows do not change.
  • The row stays on one line (h-7). A long name and the branch scroll together in the existing marquee, and the tooltip reads name · branch.

Changes:

  • getV2WorkspaceBranchSubtitle: a new helper next to the row, with unit tests.
  • WorkspaceNameMarquee: a new optional suffix prop, with a test.
  • DashboardSidebarExpandedWorkspaceRow: passes the suffix.

Closes #6520

How I tested it

I ran the dev desktop app from this branch (RENDERER_REMOTE_DEBUG_PORT with CDP, signed in as the local dev admin). I imported a test repo with its checkout on feat/login-redirect, then created four workspaces: a local one with the default name local, a local one named Fix login redirect, a local one named the same as the branch, and a worktree refactor auth. For "before" I removed only the suffix prop from the row and reloaded the app.

BeforeAfter
pr-8943-beforepr-8943-after
  • Only the two named local rows show the branch. The row that has the branch as its name and the worktree row do not change.
  • I measured all rows with CDP: 28px high both before and after.
  • bun run lint: clean. bun run typecheck: 40/40.
  • bun run test: everything passes except @superset/workspace-fs → search.adversarial3.test.ts ("truncation tears the walk down", expects < 31 readdir calls, gets 32). It also fails when I run the package alone. This PR does not touch that package.

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
  • I have signed the CLA (the bot asks on your first PR)

Summary by cubic

Displays the checkout branch as a muted mono suffix after the name on local workspace sidebar rows, so the branch is visible without opening the hover card or ⌘K.

  • The suffix is hidden when the branch matches the displayed name (case-insensitive) or when the branch is empty; worktree and session rows are unchanged.
  • Rows keep a single-line height and the tooltip now reads name · branch.

Summary by CodeRabbit

  • New Features
    • Dashboard workspace rows now show a local workspace’s branch alongside its name when it differs from the workspace name.
    • Branch names appear in smaller, muted monospace text and are included in the row’s full title.