Skip to content

feat: show workspace badge in agent chat top bar - #23964

Merged
DanielleMaywood merged 24 commits into
mainfrom
dm/agent-chat-workspace-badge
Apr 2, 2026
Merged

DanielleMaywood merged 24 commits into
mainfrom
dm/agent-chat-workspace-badge

Conversation

@DanielleMaywood

Copy link
Copy Markdown
Collaborator

🤖 This PR was written by Coder Agent on behalf of Danielle Maywood 🤖

Adds a visible workspace status badge to the ChatTopBar so users can see the attached workspace at a glance. Previously, viewing the workspace required clicking the ellipsis menu and selecting "View Workspace".

The badge shows a colored status dot and the workspace name, with a tooltip displaying the full status text. Clicking navigates to the workspace page.

Implementation details

Changes:

  • ChatTopBar.tsx — Added WorkspaceBadge component with status dot (using existing StatusIndicatorDot + getDisplayWorkspaceStatus patterns) and workspace name link. Added workspaceData and workspaceRoute optional props.
  • AgentChatPageView.tsx — Constructs workspace route and passes workspaceData/workspaceRoute to ChatTopBar.
  • AgentChatPage.tsx — Passes workspace object to AgentChatPageView (prop already existed on the interface but wasn't being passed).
  • ChatTopBar.stories.tsx — Added WithWorkspace, WithWorkspaceStopped, and WithWorkspaceAndPR stories.

Design decisions:

  • Styled identically to the existing PR badge (border pill with icon + truncated text) for visual consistency.
  • Badge renders between the title area and PR badge, placed before the actions area.
  • Uses target="_blank" to match the existing "View Workspace" behavior.
  • Reuses the same statusVariantMap as WorkspaceStatusIndicator for color consistency.
  • The "View Workspace" menu item remains in the ellipsis dropdown for discoverability.

Adds a visible workspace status badge to the ChatTopBar so users
can see the attached workspace name and status at a glance, and
click to navigate to it. Previously this required clicking the
ellipsis menu and selecting 'View Workspace'.

The badge shows a colored status dot (matching WorkspaceStatusIndicator
conventions) and the workspace name, with a tooltip showing the status
text. Clicking opens the workspace page in a new tab.
@github-actions github-actions Bot added the community Pull Requests and issues created by the community. label Apr 2, 2026
The bare name + dot wasn't obviously a workspace. Now shows a
MonitorIcon (matching the dropdown's 'View Workspace' item) and
the tooltip reads 'Workspace: Running' instead of just 'Running'.
On mobile, the workspace name is hidden — the badge collapses to
just MonitorIcon + StatusDot (~40px). The tooltip shows the full
name and status on hover/long-press. This prevents the workspace
and PR badges from crowding out the chat title on small viewports.

Both badges now live inside a shared container so they're treated
as a single layout unit. Added MobileWithWorkspaceAndPR story to
cover the narrow-viewport scenario.
…ents

Moved ChatTopBar.tsx into components/ChatTopBar/ directory and
extracted WorkspaceBadge and PullRequestBadge into their own files.
Also fixed a stray {" "} in the JSX.

The PR badge logic (url parsing, hasPR check, render-or-null) now
lives in PullRequestBadge, which simplifies ChatTopBar and makes
the badge independently testable.
Destructure diffStatusData directly, remove redundant pr-prefixed
locals, deduplicate label logic, and simplify the early return
guard.
The workspace badge now renders as a ToolBadge pill in the chat
input toolbar, alongside existing MCP server pills. This leverages
the existing pill infrastructure that already shows a workspace
pill on the create-chat page.

The pill is non-removable (no X button), clickable (links to the
workspace page), and shows a status dot. It appears for loaded
chats that have an attached workspace.

Removes the workspace badge from ChatTopBar since the info now
lives in the input toolbar, freeing top-bar space on mobile.
Reverts all ChatTopBar changes (directory split, WorkspaceBadge,
PullRequestBadge extraction). The workspace indicator now lives
solely in the input toolbar pills.
@DanielleMaywood
DanielleMaywood force-pushed the dm/agent-chat-workspace-badge branch from d54fc25 to af57834 Compare April 2, 2026 14:33
Replace the StatusIndicatorDot (bright, bordered, 12px) with a
simple 6px circle using muted color classes. Running is a soft
green (bg-content-success/60), stopped is a faded grey, and
error/warning states stay vivid. Feels more like a power LED
than a status badge.
Replaces the colored dot with shape-based status icons so the
indicator doesn't rely on color alone:
- Running: filled circle (muted green)
- Starting/pending: spinning loader (grey)
- Stopped/inactive: square (faded grey)
- Error/warning: alert triangle (red/orange)

Shape communicates state independently of color, making the
indicator accessible to users with color vision deficiency.
Running is a 6px filled dot, stopped is a 6px ring (border only).
Lucide's CircleIcon was too chunky at small sizes — a plain span
with rounded-full reads much cleaner as a status LED.
The hollow ring at 6px was invisible. Stopped now uses the same
filled dot as running but in a faded grey (bg-content-secondary/40)
so it's clearly visible but reads as 'dim' next to running's green.
The dot is the power indicator — its presence means the workspace
is running. No dot means off. This is accessible without color
since the distinction is presence vs absence, not hue.
Stopped workspaces show a small muted moon icon instead of nothing,
conveying 'sleeping/off'. Distinct shape from the filled dot
(running), spinner (starting), and alert triangle (error).
Replace the separate status icon to the right of the name with
monitor icon variants on the left:
- MonitorIcon: running
- MonitorPauseIcon: stopped
- MonitorXIcon: error/warning
- MonitorDotIcon: starting/pending

Single icon communicates both 'this is a workspace' and its state.
@DanielleMaywood DanielleMaywood removed the community Pull Requests and issues created by the community. label Apr 2, 2026
Shows the workspace status text (Running, Stopped, Starting, etc.)
on hover. Also threads statusLabel through ChatPageContent and
updates all stories.
- Fix mangled indentation on statusLabel line in AgentChatPageView
- Extract shared AttachedWorkspaceInfo type to avoid duplication
  across AgentChatInput and ChatPageContent
- Fix story statusLabel values to match actual output
  ('Workspace running' not 'Running')
- Restore removed blank line between import groups
P2 fixes:
- Unhealthy workspace tooltip now reads 'Workspace running
  (unhealthy)' instead of contradicting the MonitorXIcon with
  'Workspace running'. (Edge Case, Contract Auditor, Frontend)
- WebSocket dedup now compares health.healthy so the badge icon
  updates when a workspace transitions to/from unhealthy without
  a build status change. (Contract Auditor)

P3 fixes:
- Add rel='noreferrer' to the workspace badge Link for convention
  consistency with other target='_blank' links. (Frontend)

Nit fixes:
- Use intersection type for attached-workspace ToolBadgeData
  variant to stay in sync with AttachedWorkspaceInfo. (Style,
  Modernization)
@DanielleMaywood
DanielleMaywood marked this pull request as ready for review April 2, 2026 16:30
return (
<ToolBadge
key={badge.kind === "workspace" ? "ws" : badge.server.id}
key={badge.kind === "mcp" ? badge.server.id : badge.kind}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the diff resolution in git is lovely sometimes

@DanielleMaywood
DanielleMaywood merged commit d5ed51a into main Apr 2, 2026
31 of 32 checks passed
@DanielleMaywood
DanielleMaywood deleted the dm/agent-chat-workspace-badge branch April 2, 2026 16:49
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants