The implementation is complete. Here's a summary of the changes made: (#1871)
## Summary
I've implemented the GitHub PR status display on `WorkspaceSummary.tsx`. The changes include:
### Backend Changes
1. **`crates/db/src/models/merge.rs`** - Added a new method `get_latest_pr_status_for_workspaces()` that efficiently queries the latest PR status for all workspaces grouped by archived status.
2. **`crates/server/src/routes/task_attempts/workspace_summary.rs`** - Added `pr_status: Option<MergeStatus>` field to the `WorkspaceSummary` struct and included the PR status query in the summary endpoint.
### Frontend Changes
3. **`frontend/src/components/ui-new/hooks/useWorkspaces.ts`** - Added `prStatus` to the `SidebarWorkspace` interface and mapped it in `toSidebarWorkspace()`.
4. **`frontend/src/components/ui-new/primitives/WorkspaceSummary.tsx`** - Added:
- Import for `GitPullRequestIcon`
- `prStatus` prop to the component
- Display logic showing:
- **PR open**: `GitPullRequestIcon` with `text-brand` (orange) color
- **PR merged**: `GitPullRequestIcon` with `text-success` (green) color
- **No PR/closed/unknown**: No icon displayed
5. **`frontend/src/components/ui-new/views/WorkspacesSidebar.tsx`** - Passed the `prStatus` prop to both active and archived workspace summaries.
### Generated Types
6. **`shared/types.ts`** - Auto-generated to include the new `pr_status` field in `WorkspaceSummary`.
This commit is contained in:
committed by
GitHub
parent
b743f849f7
commit
af70dd9239
@@ -352,7 +352,11 @@ has_running_dev_server: boolean,
|
||||
/**
|
||||
* Does this workspace have unseen coding agent turns?
|
||||
*/
|
||||
has_unseen_turns: boolean, };
|
||||
has_unseen_turns: boolean,
|
||||
/**
|
||||
* PR status for this workspace (if any PR exists)
|
||||
*/
|
||||
pr_status: MergeStatus | null, };
|
||||
|
||||
export type WorkspaceSummaryResponse = { summaries: Array<WorkspaceSummary>, };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user