Skip to content

refactor(web): move the thread's linked pull request out of ChatView - #20308

Merged
juliusmarminge merged 1 commit into
chatview-split/queuefrom
chatview-split/pull-requests
Oct 17, 2026
Merged

juliusmarminge merged 1 commit into
chatview-split/queuefrom
chatview-split/pull-requests

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Part of the ChatView split so the React Compiler can compile it.

useThreadLinkedPullRequest now works out which change request a thread is linked to. When the linked one is merged or closed and the branch has a newer open one, the newer one replaces it. The hook also owns the effect that relinks the thread on the server and moves an open panel to the new PR. ChatView gets back linked, linkedKey and hasDetail.

The hook drops its manual useMemo, compiles, and goes on the compile-required lint list (#20292). This also removes the unused threadRepository variable.

Stack progress

Layer ChatView lines ChatView component body Compiler on ChatView Files held to strict compiler lint
main 11,660 10,007 crashes (internal error) 0
#20161 pending approvals and questions hook 11,222 9,624 crashes (internal error) 0
#20164 terminal drawer and panel file 10,614 9,624 crashes (internal error) 0
#20289 one terminal open/close hook 10,466 9,481 crashes (internal error) 0
#20292 compile-required lint list 10,466 9,481 crashes (internal error) 2
#20294 pending hook compiles 10,466 9,481 crashes (internal error) 3
#20296 /usage-limits panel hook 10,397 9,416 crashes (internal error) 4
#20304 queued-message editing hook 10,172 9,200 crashes (internal error) 5
→ #20308 linked pull request hook 10,078 9,106 crashes (internal error) 6
#20309 proactive panel hook 9,950 8,984 crashes (internal error) 7
#20312 agent-opened previews hook 9,855 8,890 crashes (internal error) 8
#20315 right panel close hook 9,743 8,779 crashes (internal error) 9
#20316 worktree setup hook 9,660 8,695 crashes (internal error) 10
#20321 two onSend phases split out 9,660 8,613 crashes (internal error) 10
#20340 compiler no longer crashes on ChatView 9,647 8,599 skips (32 reasons) 10
#20379 ChatView compiles 9,616 8,469 compiles 11
#20380 re-render fixes from profiling 9,661 8,514 compiles 11
#20392 provider pushes keep identity 9,628 8,481 compiles 11
#20393 keyboard shortcuts command map 9,340 8,265 compiles 13
#20396 Sidebar compiles, no manual memos 9,340 8,265 compiles 14
#20397 ChatComposer compiles 9,340 8,265 compiles 14
#20401 project script editing hook 9,110 8,049 compiles 15
#20402 MessagesTimeline compiles 9,110 8,049 compiles 16
#20418 ChatView strict: no memos, no sync effects 8,901 7,855 compiles 17

Measured with the native React Compiler (oxc-transform-react) on each layer's ChatView.tsx. "Crashes" means it hit an internal codegen error and left ChatView uncompiled; "skips" means it reported reasons it could not compile it. Strict files must compile with no bailouts, no manual memoization and no effect-rule violations; lint and reactCompiledFiles.test.ts enforce it.

🤖 Generated with Claude Code (Claude Opus 5.5)


Devin Review

@juliusmarminge
juliusmarminge added this pull request to stack #20165 October 16, 2026 16:30
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Oct 16, 2026
@juliusmarminge
juliusmarminge marked this pull request as ready for review October 16, 2026 16:52
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Oct 16, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 9df7d31

Macroscope's review found this PR approvable — This PR extracts existing linked pull-request resolution and relinking behavior from ChatView into a dedicated hook without introducing a new capability or changing product defaults. The compiler configuration addition only applies existing static checks to the extracted file, while runtime side effects remain bounded to the behavior being moved.

No code changes detected at 398f288. Prior analysis still applies.

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

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 40b73d5c-2120-4314-8e58-72c29563bdab
📥 Commits

Reviewing files that changed from the base of the PR and between 9df7d31 and 398f288.

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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 2d44e92e-bfbb-4477-8c24-7c5843d596ab
📥 Commits

Reviewing files that changed from the base of the PR and between e66da23 and 9df7d31.

📒 Files selected for processing: 2
  • apps/web/src/components/ChatView.tsx
  • vite.config.ts

Limit details: You’ve used all 10 included reviews currently available.

📝 Walkthrough

The pull request moves linked pull request selection and server-thread relinking from ChatView into useThreadLinkedPullRequest. ChatView supplies the hook’s context and uses its linked pull request, key, and detail-availability results.

Changes: Thread-linked pull request handling

Layer / File(s) Summary
Select the linked pull request
apps/web/src/components/pullRequest/useThreadLinkedPullRequest.ts
The hook selects an open pull request on the thread’s branch when the persisted link is merged or closed and the replacement differs from that link. It returns the selected link, its key, and whether persisted-link details are available.
Relink server-backed threads
apps/web/src/components/pullRequest/useThreadLinkedPullRequest.ts
For server-backed threads, the hook queues metadata relinks, skips stale queued writes, updates an open panel when it matches the persisted link, and handles write failures.
Connect ChatView to the hook
apps/web/src/components/ChatView.tsx, vite.config.ts
ChatView passes the thread and pull-request context to the hook and uses its results. The Vite React Compiler lint override includes the new hook.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Refactor

Suggested reviewers: t3dotgg

Merge Risk: ⚪ Minimal · up to 9df7d

This is a refactor that moves linked pull request handling into a hook, and no concrete risk was found in the supplied changes.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description explains the implementation changes, but it omits the required Problem, Scope and approval, and Verification sections. It does not provide an issue or maintainer approval reference, fo… Rewrite the description using the required headings. Add the problem and expected behavior, link the triaged issue or maintainer approval, and document focused tests or manual checks with observed results. Include UI evidence or explain why…
Passed Passed checks: 3 passed
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly describes the main change: moving linked pull request handling from ChatView into a dedicated hook.
Full details: Description check

Explanation

The description explains the implementation changes, but it omits the required Problem, Scope and approval, and Verification sections. It does not provide an issue or maintainer approval reference, focused test results, or manual verification details.

Resolution

Rewrite the description using the required headings. Add the problem and expected behavior, link the triaged issue or maintainer approval, and document focused tests or manual checks with observed results. Include UI evidence or explain why no UI behavior changed.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@juliusmarminge
juliusmarminge force-pushed the chatview-split/pull-requests branch from e66da23 to 9df7d31 Compare October 16, 2026 17:03
@macroscopeapp
macroscopeapp Bot dismissed their stale review October 16, 2026 17:03

Dismissing prior approval to re-evaluate 9df7d31

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire — 5.0 KiB — 6.8 KiB ✅
Codex Thread snapshot wire — 3.8 KiB — 4.9 KiB ✅
Codex Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅
Codex Live turn WebSocket decoded — 20.9 KiB — 29.3 KiB ✅
Codex Live turn messages — 2 — 8 ✅
Claude Total thread wire — 5.0 KiB — 6.8 KiB ✅
Claude Thread snapshot wire — 3.8 KiB — 4.9 KiB ✅
Claude Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅
Claude Live turn WebSocket decoded — 21.2 KiB — 29.3 KiB ✅
Claude Live turn messages — 2 — 8 ✅

Baseline: unavailable · PR result: 398f288 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

useThreadLinkedPullRequest resolves which change request a thread is
linked to, including replacing a merged or closed one with the branch's
newer open one, and owns the effect that relinks it on the server and
retargets an open panel. It compiles and joins the compile-required list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge
juliusmarminge force-pushed the chatview-split/pull-requests branch from 9df7d31 to 398f288 Compare October 17, 2026 00:11
@juliusmarminge
juliusmarminge merged commit 9302235 into main Oct 17, 2026
30 checks passed
@juliusmarminge
juliusmarminge deleted the chatview-split/pull-requests branch October 17, 2026 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 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.

1 participant