Skip to content

feat(agents): add PR title, draft, and status icons to sidebar#22952

Merged
kylecarbs merged 1 commit intomainfrom
kylecarbs/pr-status-sidebar
Mar 11, 2026
Merged

feat(agents): add PR title, draft, and status icons to sidebar#22952
kylecarbs merged 1 commit intomainfrom
kylecarbs/pr-status-sidebar

Conversation

@kylecarbs
Copy link
Copy Markdown
Member

Adds pull_request_title and pull_request_draft to the chat diff status pipeline (DB → provider → SDK → frontend). The GitHub provider now fetches the PR title alongside existing status fields.

The agents sidebar now displays PR-state-aware icons for chats that have a linked pull request (when the chat is in waiting/completed state):

  • Open PR: GitPullRequestArrow (green)
  • Draft PR: GitPullRequestDraft (gray)
  • Merged PR: GitMerge (purple)
  • Closed PR: GitPullRequestClosed (red)

Running/pending/paused/error chats keep their existing activity icons (spinner, pause, error triangle).

Changes

Database migration (000432): Adds pull_request_title TEXT and pull_request_draft BOOLEAN columns to chat_diff_statuses.

Backend pipeline:

  • gitprovider.PRStatus gains a Title field
  • GitHub provider decodes the title from the API response
  • gitsync and coderd/chats.go pass title + draft through to the DB upsert
  • codersdk.ChatDiffStatus exposes both new fields in the API response

Frontend (AgentsSidebar.tsx): New getPRIconConfig() function resolves the appropriate Lucide git icon based on pull_request_state and pull_request_draft. Only applies when the chat is in a terminal state (waiting/completed).

Real-time sync: No changes needed — the existing diff_status_change pubsub event already propagates the full ChatDiffStatus including the new fields.

@kylecarbs kylecarbs force-pushed the kylecarbs/pr-status-sidebar branch 2 times, most recently from ae1694a to 82270ef Compare March 11, 2026 15:11
Adds pull_request_title and pull_request_draft to the chat diff status
pipeline (DB → provider → SDK → frontend). The GitHub provider now
fetches the PR title alongside existing status fields.

The agents sidebar now displays PR-state-aware icons for chats that
have a linked pull request (when the chat is in waiting/completed
state):
- Open PR: GitPullRequestArrow (green)
- Draft PR: GitPullRequestDraft (gray)
- Merged PR: GitMerge (purple)
- Closed PR: GitPullRequestClosed (red)

Running/pending/paused/error chats keep their existing activity icons.
Real-time sync requires no changes — the existing diff_status_change
pubsub event already propagates the full ChatDiffStatus.
@kylecarbs kylecarbs force-pushed the kylecarbs/pr-status-sidebar branch from 82270ef to 85d230a Compare March 11, 2026 15:39
@kylecarbs kylecarbs requested a review from hugodutka March 11, 2026 15:43
@kylecarbs kylecarbs merged commit 7a83d82 into main Mar 11, 2026
27 checks passed
@kylecarbs kylecarbs deleted the kylecarbs/pr-status-sidebar branch March 11, 2026 15:50
@github-actions github-actions bot locked and limited conversation to collaborators Mar 11, 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