refactor(web): move the persistent terminal drawer and panel out of ChatView.tsx #20164
chatview-split/pending-requests fromrefs/pull/20164/head·merged by juliusmarminge View on GitHubChatView.tsx holds the persistent terminal drawer and the right-panel terminal as module-level components. They have nothing to do with ChatView's own body, but they add 600 lines to the file and are the base the next layer builds on.
Change#
PersistentThreadTerminalDrawer, PersistentThreadTerminalPanel, their prop types and their two id-list helpers move unchanged into components/PersistentThreadTerminals.tsx. PersistentTerminalLaunchContext is spelled out as its own type there, instead of being picked from ChatView's private TerminalLaunchContext.
No behavior change. React Compiler time is unchanged: these components were already compiled separately, so the 600 lines leave the file but not ChatView's function body.
Verification#
- Typecheck passes. Lint warning counts match
main. - The ChatView logic and terminal drawer tests pass.
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
- 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:XXL
juliusmarminge added labelsmacroscope-review
Approvability#
Verdict: Approved at
1676a5fMacroscope's review found this PR approvable — This PR cleanly extracts the existing persistent terminal drawer and panel into a dedicated module without changing their behavior, call sites, or product defaults. The large diff is primarily relocation of existing code rather than new runtime logic.
No code changes detected at
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).e244708. Prior analysis still applies.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:
df45f307-28e7-4d7d-be53-a44e5bfad24c
📥 Commits
-
Reviewing files that changed from the base of the PR and between e13566ce0b12a3301d81de1fe4dc5c7e2f4b841d and 1676a5fc36453c2d33fa12fab5d984990b66d62d.
📒 Files selected for processing: 1
-
apps/web/src/components/ChatView.tsx
Limit details: You’ve used all 10 included reviews currently available.
-
📝 Walkthrough
-
Persistent terminal drawer and panel components now reside in
PersistentThreadTerminals.tsx.ChatView.tsximports these components instead of defining them locally.Changes: Persistent thread terminals
Layer / File(s) Summary Drawer state and terminal actions
apps/web/src/components/PersistentThreadTerminals.tsxThe drawer derives terminal state and launch locations, reconciles terminal IDs, and handles terminal creation, splitting, activation, and closing. Panel launch locations and rendering
apps/web/src/components/PersistentThreadTerminals.tsxThe panel resolves terminal labels and launch locations from session summaries, launch context, thread state, and project defaults. It renders the terminal surface in panel mode. ChatView component integration
apps/web/src/components/ChatView.tsxChatViewimports the persistent drawer and panel components and removes their local implementations and related declarations.Priority: ⬇️ Low
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Refactor
Suggested reviewers:
t3dotgg
Merge Risk: ⚪ Minimal · up to
1676a-
This change moves the persistent terminal drawer and panel components out of the chat view into their own module, with no intended change in behavior. No concrete issues were found, and the change looks safe to merge.
Pre-merge checks:
3 · 1-
Failed checks: 1 warningCheck name Status Explanation Resolution Description check The description explains the change and lists verification results, but it omits the required Scope and approval section. It also does not provide before-and-after screenshots for the UI change. The p… Add the required Problem and Scope and approval sections. Include the linked issue or explicit maintainer approval, or explain why the change qualifies for an exemption. Add before-and-after screenshots for the UI change, and include a reco… 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 and concisely describes the main refactor: moving the persistent terminal drawer and panel out of ChatView.tsx.
Full details: Description check
-
Explanation
The description explains the change and lists verification results, but it omits the required Scope and approval section. It also does not provide before-and-after screenshots for the UI change. The problem statement is present but is not organized under the required Problem heading.
Resolution
Add the required Problem and Scope and approval sections. Include the linked issue or explicit maintainer approval, or explain why the change qualifies for an exemption. Add before-and-after screenshots for the UI change, and include a recording if interaction details require it.
-
- Fix all pre-merge checks with AI
✨ 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
juliusmarminge merged thise00cda2
juliusmarminge closed this
Sign in to join this conversation.
Thread transfer impact#
⚠️ The latest CI run did not produce a thread transfer result for
e244708.This comment will update automatically after the next completed run.