Uh oh!
There was an error while loading. Please reload this page.
Unify git status PR metadata and surface PR state in server and UI - #122
Merged
Conversation
- extend `GitStatusResult` with nullable `mergedPr` metadata - in server git status, query merged PR only when no open PR is found - in sidebar, display a `Merged` status pill for threads on branches with merged PRs - update server/web/contracts tests for the new status shape
- server: only query open PRs when the current branch has an upstream; still fall back to merged PR lookup - tests: cover status behavior for branches without upstream tracking - web: fetch git status once per cwd, validate query data with schema parsing, and map merged PR badges by thread branch match
- Replace `openPr`/`mergedPr` with `pr` in server and contracts - Add PR `state` (`open`/`closed`/`merged`) to git status schema - Resolve latest branch PR via `gh pr list --state all` sorted by `updatedAt`
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
- Update GitManager PR selection to return the latest open PR before merged ones - Add regression test covering open-vs-merged ordering by updatedAt
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Uh oh!
There was an error while loading. Please reload this page.
youpele52 referenced
this pull request
in youpele52/bigbud
Jun 17, 2026
dcherrera pushed a commit
to dcherrera/t3code
that referenced
this pull request
Jul 7, 2026
NeilTheFisher pushed a commit
to NeilTheFisher/t3code
that referenced
this pull request
Aug 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gitStatus.openPrwith a unifiedgitStatus.probject in shared contracts and all server/web call sites.open,closed,merged) and prefer an open PR when present.GitManager(including state andupdatedAthandling) with graceful fallback tonullon lookup failures.pr.state === "open"as an existing open PR for action gating and CTA behavior.prshape and new PR-state behavior.Testing
apps/server/src/git/Layers/GitManager.test.ts: added/updated cases for open PR metadata, merged PR fallback, open-vs-merged precedence, and GH lookup failure fallback.apps/web/src/components/GitActionsControl.logic.test.ts: updated logic tests to the newprfield and explicitstatehandling.apps/server/src/wsServer.test.ts: updated git status fixture to usepr.Note
Medium Risk
Medium risk because this is a cross-cutting contract change (
GitStatusResult) that updates server/client call sites and adds newgh pr listparsing/sorting logic, which could cause status/action regressions if PR data is unexpected.Overview
Unifies git status PR metadata by replacing
GitStatusResult.openPrwithGitStatusResult.pr(now includingstate: open|closed|merged) across contracts, server, and web consumers.Improves PR lookup in
GitManager.statusto query the latest relevant PR across all states viagh pr list --state all, normalize/parse results (includingupdatedAt), and prefer an open PR when present, falling back tonullon lookup/parse failures.Updates UI behavior and indicators so git actions only treat
pr.state === "open"as an existing open PR (menu gating + “Open PR” CTAs), and the sidebar shows per-thread PR state icons by polling git status per repo/worktree.Tests are updated/expanded to cover the new
prshape and merged/open precedence cases.Written by Cursor Bugbot for commit 7f2a95f. This will update automatically on new commits. Configure here.
Note
Unify Git status PR metadata by renaming
GitCore.makeGitCore.statusresult field toprand surface PR state across server contracts and UI, includingGitManager.statususingfindLatestPrwith--limit 20and--state allIntroduce
prwithstatein wire contracts and server status, add PR parsing and latest selection, and update UI logic to treat onlystate === "open"as an existing PR; start withGitManager.statusandfindLatestPrin GitManager.ts.📍Where to Start
Start with the
GitManager.statushandler and thefindLatestPreffect in GitManager.ts, then reviewparsePullRequestListandtoStatusPr.Macroscope summarized 7f2a95f.