refactor(web): move the thread's linked pull request out of ChatView #20308
chatview-split/queue fromrefs/pull/20308/head·merged by juliusmarminge View on GitHubPart 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)
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
Approvability#
Verdict: Approved at
9df7d31Macroscope'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
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).398f288. Prior analysis still applies.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 9df7d31afcbca1a59d3b84406d038bc22949a242 and 398f2883ed1b7b658cc18409a92d608c190693f2.
You can disable this status message by setting the
reviews.review_statustofalsein 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 e66da23fc298c0426128a59de922cb5045ceb873 and 9df7d31afcbca1a59d3b84406d038bc22949a242.
📒 Files selected for processing: 2
-
apps/web/src/components/ChatView.tsxvite.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
ChatViewintouseThreadLinkedPullRequest.ChatViewsupplies 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.tsThe 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.tsFor 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.tsChatViewpasses 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:
3 · 1-
Failed checks: 1 warningCheck name Status Explanation Resolution Description check 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 checks: 3 passed-
Check name Status Explanation Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request. Title check 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
-
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
ℹ️ No successful
mainbaseline 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: successScenario 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.
juliusmarminge merged this9302235
juliusmarminge closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed