Skip to content

fix(web): open PR links in the thread's own checkout - #19

Merged
Fryuni merged 1 commit into
mainfrom
t3code/fix-thread-button-wrong-project
Sep 18, 2026
Merged

Fryuni merged 1 commit into
mainfrom
t3code/fix-thread-button-wrong-project

Conversation

@Fryuni

@Fryuni Fryuni commented Sep 18, 2026

Copy link
Copy Markdown
Owner

What Changed

When a pull request link is opened beside a thread, findProjectForChangeRequest now accepts a preferredProjectId — the thread's own project — and prefers it when multiple projects in the same environment hold checkouts of the same repository. useOpenChangeRequestLink resolves the thread's project via readThreadShell and passes it through both the exact-project and host-fallback lookups. A preferred project that does not hold the repository is ignored, so the existing match rules still decide.

Why

One environment can hold two checkouts of the same repository under different projects, and both match the link. The lookup could pick either one, so the right panel could treat the thread's own pull request as somebody else's branch — showing it as not-home and handing the work back to the wrong project. The thread the link is opened beside is the meaning the user intends, so its checkout wins.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

- When two projects hold the same repository, `findProjectForChangeRequest` now prefers the thread's own project, so the panel attributes the PR to the thread it sits beside
Copilot AI lite review requested due to automatic review settings September 18, 2026 02:10
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-18T02:14:08.963271Z d9801cf PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved review comments; coverage includes preferred matching and fallback behavior.

Pull request overview

Updates pull-request link resolution to prefer the thread’s own project when duplicate repository checkouts exist.

Changes:

  • Passes the thread’s project through exact and host-fallback lookups.
  • Adds tests for preferred-project matching and fallback behavior.
File summaries
File Summary
apps/web/src/lib/openPullRequestLink.ts Prefers the thread’s project when resolving links.
apps/web/src/lib/openPullRequestLink.test.ts Tests preferred-project and fallback behavior.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@Fryuni
Fryuni enabled auto-merge September 18, 2026 02:13
@Fryuni
Fryuni merged commit eb13d0e into main Sep 18, 2026
9 checks passed
@Fryuni
Fryuni deleted the t3code/fix-thread-button-wrong-project branch September 18, 2026 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants