refactor(web): ChatView's paste-to-focus, titlebar controls, and timeline overlays move out#23072

merged3
main
refactor/split2-chatview-overlays
opened3d agobyJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 3d ago

The last pieces that read nothing else in ChatView: paste-to-focus becomes chat/usePasteToFocusComposer.ts; the titlebar's panel controls become ThreadPanelHeaderControl and WorkspaceTitlebarControls next to PanelLayoutControls; the drop overlay and the scroll-to-end button become components in chat/TimelineOverlays.tsx. Markup and classes are unchanged.

BeforeAfter
ChatView.tsx lines4,0723,975

Renders, median of 3, counted with the commit-only fiber counter on a dev server seeded from real data (stack top vs the stack's base; "ChatView" is ChatView's own render count):

InteractionBefore: commits / renders / ChatViewAfter: commits / renders / ChatView
Type 20 chars in the composer22 / 351 / 122 / 351 / 1
Streaming reply (12 lines)129 / 3412 / 18134 / 3406 / 18
Switch threads26 / 1520 / 526 / 1480 / 5
Open and close the right panel14 / 603 / 414 / 569 / 4

No render boundary moved in a way that changes these: the hooks run inside ChatView, and the new leaf components are small. The point of the stack is readability and per-file compiler caching, not a render win.

Tests: tsc-rs --noEmit for apps/web, oxlint on the changed files, vp test run src/components/ChatView.logic.test.ts, and the React Compiler coverage test for every changed file (0 bailouts). ChatView stays in the coverage test's slow set.

Part of the ChatView split (7,258 → 3,975 lines across the stack).

Opus 5.5, Claude Code.

🤖 Generated with Claude Code

Checks

All checks passed
Synced from GitHub

Approvability

Verdict: Approved at 072bd17

Macroscope's review found this PR approvable — This is a contained refactor that moves existing paste handling and overlay/titlebar markup into dedicated modules without changing their behavior or public data contracts. The extracted code preserves the original listeners, props, callbacks, and rendered structure.

No code changes detected at c6cd722. Prior analysis still applies.

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

Synced from GitHub

Review in Change Stack →

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: e5534ebc-6efd-4113-8085-aed5838de430
📥 Commits

Reviewing files that changed from the base of the PR and between 072bd1722fd163ef63b556e1df2beba8ac5235c0 and c6cd722894aa8f10feaf4c2b8855e68014ebee58.

📒 Files selected for processing: 1
  • apps/web/src/components/ChatView.tsx

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

📝 Walkthrough

ChatView now delegates paste-to-composer behavior to a hook and uses dedicated components for workspace controls, the file-drop overlay, and the scroll-to-end button.

Changes: ChatView component extraction

Layer / File(s)Summary
Composer paste handling
apps/web/src/components/chat/usePasteToFocusComposer.ts, apps/web/src/components/ChatView.tsx
The hook handles eligible paste events, paste-as-text timing, clipboard context, and composer insertion. ChatView replaces its inline listeners with the hook.
Workspace and thread-panel controls
apps/web/src/components/chat/PanelLayoutControls.tsx, apps/web/src/components/ChatView.tsx
New components render thread-panel controls and the conditional maximize control. ChatView passes the existing panel and maximize state.
Workspace and timeline overlays
apps/web/src/components/chat/TimelineOverlays.tsx, apps/web/src/components/ChatView.tsx
New components render the file-drop overlay and scroll-to-end button. ChatView preserves the existing scroll positioning and composer restoration behavior.

Priority: ⬇️ Low

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

Change: Refactor

Possibly related issues

  • pingdotgg/t3code#12372 — The PR extracts the scroll-to-end control, but the change summary does not establish a fix for its thread-switch visibility behavior.

Suggested reviewers: t3dotgg

Merge Risk: ⚪ Minimal · up to c6cd7

No actionable risk from this extraction remains after normal checks; the PR is mergeable.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check nameStatusExplanationResolution
Description checkWarningThe description clearly explains the refactor and includes detailed verification results. It does not provide the required Problem or Scope and approval sections, and it omits the required before/afte…Add the Problem section with expected behavior and context. Add the Scope and approval section with the linked issue or maintainer approval, or explain why the focused refactor qualifies for an exemption. Add clear before/after screenshots …
Passed Passed checks: 3 passed
Check nameStatusExplanation
Title checkPassedThe title clearly identifies the main refactor: moving paste-to-focus logic, title-bar controls, and timeline overlays out of ChatView.
Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description clearly explains the refactor and includes detailed verification results. It does not provide the required Problem or Scope and approval sections, and it omits the required before/after UI screenshots.

Resolution

Add the Problem section with expected behavior and context. Add the Scope and approval section with the linked issue or maintainer approval, or explain why the focused refactor qualifies for an exemption. Add clear before/after screenshots for the UI changes.

✨ 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

Usage-based review receipt

Note

This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing.

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

Added 3 commits

  • refactor(web): ChatView's titlebar panel controls are components in PanelLayoutControls7b709bd
  • refactor(web): ChatView's paste-to-focus lives in usePasteToFocusComposerb40ed61
  • refactor(web): ChatView's drop overlay and scroll-to-end button are componentsc6cd722
Synced from GitHub

Thread transfer impact

⚠️ The latest CI run did not produce a thread transfer result for c6cd722.

This comment will update automatically after the next completed run.