Skip to content

fix(web): linked pull requests stay in the thread panel - #8188

Closed
RakshithBhat03 wants to merge 3 commits into
pingdotgg:mainfrom
RakshithBhat03:fix/pr-links-preserve-thread
Closed

fix(web): linked pull requests stay in the thread panel#8188
RakshithBhat03 wants to merge 3 commits into
pingdotgg:mainfrom
RakshithBhat03:fix/pr-links-preserve-thread

Conversation

@RakshithBhat03

@RakshithBhat03 RakshithBhat03 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Opening a pull request from a chat thread keeps it in the thread's right panel. Clicking another GitHub pull request link inside that pull request instead left the thread route, opened the Pull Requests page, and lost the previous panel context.

How to reproduce

  1. Open a chat thread that contains a GitHub pull request link, such as https://github.com/pingdotgg/t3code/pull/8089.
  2. Open that pull request in the thread's right panel.
  3. In its description, click a link to another pull request, such as #6446.
  4. The app navigates to the Pull Requests page and opens the linked pull request there instead of keeping the chat thread open.

Pull request markdown rendered in a thread panel now receives the owning thread reference. The existing link handler can then open the linked pull request as another right-panel tab without changing the thread route. Pull request links opened from the standalone Pull Requests page keep their existing page-level behavior.

Tests: 37 focused tests, web typecheck, targeted lint.

Before

before-pr-link-navigation.mp4

After

after-pr-link-navigation.mp4

Built by GPT-5.6 Sol in T3 Code through the Codex harness.

Note

Fix linked pull request links to stay scoped to the thread panel

  • Adds a pullRequestLinkThreadRef prop to ChatMarkdown so pull request link navigation can bind to a specific thread even when the markdown itself isn't thread-scoped.
  • Introduces PullRequestThreadRefProvider in PullRequestMarkdown.tsx, a context that supplies a threadRef and a scopeWorkspaceToThread flag to descendants.
  • PullRequestMarkdown now passes pullRequestLinkThreadRef unconditionally and threadRef only when scopeWorkspaceToThread is true, so links stay in-thread while file/workspace actions are conditionally scoped.
  • ChatView wraps PullRequestDetailPanel in the new provider, computing activePullRequestBelongsToThread via isThreadOwnPullRequest.
  • Risk: useOpenChangeRequestLink in ChatMarkdown.tsx now prefers pullRequestLinkThreadRef ?? threadRef; callers not passing the new prop fall back to existing threadRef behavior.

Macroscope summarized 996032d.


Note

Low Risk
Localized UI routing for markdown PR links and context wiring in the thread right panel; no auth or data-layer changes.

Overview
Fixes PR-to-PR navigation from a pull request body while a chat thread is open: those links no longer jump to the standalone Pull Requests route.

ChatMarkdown gains optional pullRequestLinkThreadRef so useOpenChangeRequestLink can open another PR as a right-panel tab even when threadRef is omitted (avoiding thread-scoped file/workspace actions on foreign workspaces).

PullRequestThreadRefProvider supplies that scope from PullRequestMarkdown: it always forwards the active thread for PR link navigation, but only passes threadRef into markdown when scopeWorkspaceToThread is true. ChatView wraps the thread-panel PullRequestDetailPanel with the provider, using activePullRequestBelongsToThread to decide whether file paths should stay tied to the thread workspace versus navigation-only threading.

Tests cover the split between navigation-only and full thread scoping, plus standalone PR page behavior.

Reviewed by Cursor Bugbot for commit 996032d. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: eb1a0047-e015-4ae3-874e-b1fc52ba4c1d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Aug 25, 2026
@RakshithBhat03
RakshithBhat03 marked this pull request as ready for review August 25, 2026 10:03
@macroscopeapp

macroscopeapp Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 996032d

Macroscope's review found this PR approvable — The PR makes a focused routing/context fix for linked pull requests in the thread panel, while preserving standalone page behavior and avoiding foreign workspace actions. Its production changes are localized and supported by targeted tests.

You can add or adjust custom eligibility rules. Learn more.

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Aug 25, 2026
@RakshithBhat03
RakshithBhat03 force-pushed the fix/pr-links-preserve-thread branch from f5b9655 to 8285122 Compare August 26, 2026 08:11
@macroscopeapp
macroscopeapp Bot dismissed their stale review August 26, 2026 08:11

Dismissing prior approval to re-evaluate 8285122

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One finding: the new thread-ref provider is applied to every pull request shown beside a thread, including pull requests from another project, which lets file chips and workspace images in that body resolve against the thread's workspace instead of the pull request's.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/ChatView.tsx Outdated
@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). and removed size:S 10-29 changed lines (additions + deletions). labels Aug 26, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f754d75. Configure here.

Comment thread apps/web/src/components/ChatView.tsx Outdated
@juliusmarminge

Copy link
Copy Markdown
Member

Superseded by merged #10623 — same fix for pull-request markdown links opening in the panel (and staying in the thread panel) instead of navigating away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants