refactor(web): sidebar list markers and draft rows live in their own files#22729

merged1
refactor/sidebar-thread-row-file
refactor/sidebar-markers-and-drafts-file
opened4d agobyJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 4d ago

This PR continues splitting up Sidebar.tsx. It moves the sortable shelf headers, drag boundaries and placeholders into sidebar/SidebarListMarkers.tsx, and the unsent-draft rows and block into sidebar/SidebarDraftBlock.tsx. The code is moved as-is, with no behavior change. The draft block already subscribes to the composer draft store on its own, so it keeps re-rendering without the sidebar body, as it did before.

beforeafter
Sidebar.tsx3,483 lines3,140 lines
sidebar/SidebarListMarkers.tsx—135 lines
sidebar/SidebarDraftBlock.tsx—222 lines

Tests run:

  • React Compiler coverage for the sidebar files (0 bailouts)
  • tsc for apps/web
  • oxlint on the changed files

Claude Opus 5.5 in Claude Code.

🤖 Generated with Claude Code

Checks

All checks passed

Added 1 commit

  • refactor(web): sidebar list markers and draft rows live in their own filesaf638e8
Synced from GitHub

Approvability

Verdict: Approved at af638e8

Macroscope's review found this PR approvable — This PR reorganizes existing sidebar draft and drag-marker code into dedicated files while preserving the same logic and call sites. It does not introduce new behavior, schema changes, defaults, or static-analysis overrides.

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: 6e1499b2-0a83-4b4a-ad14-abb69d84f592
📥 Commits

Reviewing files that changed from the base of the PR and between 12757e8bc5e470d60bc1dc0eac747a9a1293cb87 and af638e8f4df7d5e2928f1996fd5f3a3c5f158e93.

📒 Files selected for processing: 3
  • apps/web/src/components/Sidebar.tsx
  • apps/web/src/components/sidebar/SidebarDraftBlock.tsx
  • apps/web/src/components/sidebar/SidebarListMarkers.tsx

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

📝 Walkthrough

Sidebar draft rows and sortable section markers now live in dedicated modules. Sidebar.tsx imports these components and removes their former in-file implementations.

Changes: Sidebar Component Extraction

Layer / File(s)Summary
Sortable section markers
apps/web/src/components/sidebar/SidebarListMarkers.tsx
Adds sortable markers, section placeholders, drag boundaries, and collapsible section headers with drop-target and drag styling.
Draft rows and selection
apps/web/src/components/sidebar/SidebarDraftBlock.tsx
Adds draft row rendering and logic to filter, scope, and sort drafts. Rows support navigation, context menus, and discard actions.
Sidebar module integration
apps/web/src/components/Sidebar.tsx
Imports the dedicated components and removes their local implementations and unused imports.

Priority: ⬇️ Low

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

Change: Refactor

Merge Risk: ⚪ Minimal · up to af638

This refactor moves sidebar markers and draft rows into separate files without intended behavior changes. No concrete merge-blocking risk was identified.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check nameStatusExplanationResolution
Description checkWarningThe description explains the refactor and lists verification commands, but it does not provide the required scope and approval details. It also does not clearly separate the problem and change section…Add the required Problem, Change, and Scope and approval sections. Link the triaged issue or maintainer approval, or explain why this focused refactor qualifies for an exemption. Expand Verification with observed results and state any check…
Passed Passed checks: 3 passed
Check nameStatusExplanation
Title checkPassedThe title clearly and concisely describes the primary change: moving sidebar list markers and draft rows into separate files.
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 explains the refactor and lists verification commands, but it does not provide the required scope and approval details. It also does not clearly separate the problem and change sections or report complete verification results.

Resolution

Add the required Problem, Change, and Scope and approval sections. Link the triaged issue or maintainer approval, or explain why this focused refactor qualifies for an exemption. Expand Verification with observed results and state any checks that could not be completed.

✨ 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.