fix(web): scope PR actions to thread branch#895
fix(web): scope PR actions to thread branch#895binbandit wants to merge 1 commit intopingdotgg:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Does this affect the UI as well? I've had issues in the past with the app where I change branches and the PR icon next to (a) thread(s) seems to appear and disappear almost out-of-sync with the branch status. |
Summary
View PRis not shown prematurelyWhy
A new thread can start with
branch: null, but the header git controls were reading repo-levelgit statusdirectly. If the repo's current branch had an open PR, the new thread incorrectly showedView PRfor that unrelated PR.Validation
bun run test src/lib/threadGitStatus.test.ts src/components/GitActionsControl.logic.test.tsbun fmtbun lintbun typecheckNote
Scope PR actions and quick actions to a thread's pinned branch
resolveThreadScopedGitStatusandresolveThreadScopedPrutilities inthreadGitStatus.tsto filterGitStatusResultbased on a thread's branch binding.GitActionsControlnow computes a thread-scoped git status and disables quick actions with a descriptive message when the active thread is pinned to a different branch than the current git branch.Sidebarreplaces inline branch-match logic withresolveThreadScopedPrto correctly map thread IDs to PRs.Macroscope summarized 92c1aab.