mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
When a PR is detected for a chat, display a compact PR badge in the AgentDetail TopBar. On mobile it is always visible; on desktop it is hidden when the sidebar panel is open (which already surfaces PR info) and shown when the panel is closed. The badge shows a state-colored icon (open, draft, merged, closed) and the PR title or number, linking to the PR URL. Only URLs confirmed as real PRs (via explicit `pull_request_state` or a `/pull/<number>` pathname) trigger the badge. ## Changes - **`TopBar.tsx`** — Added `diffStatusData` prop, `PrStateIcon` helper, and a PR link badge between the title and actions area. Hidden on desktop when the sidebar panel is open. - **`AgentDetailView.tsx`** — Pass `diffStatusData` through to `AgentDetailTopBar`. - **`TopBar.stories.tsx`** — Added stories for open, draft, merged, and closed PR states.