refactor(web): the sidebar's thread rows live in their own file#22696

merged1
main
refactor/sidebar-thread-row-file
opened3d agobyJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 3d ago

Sidebar.tsx is ~5,100 lines, and about a third of it is the thread row: the row itself, its sortable wrapper, the search-result row, and their tooltip, provider stack, snooze menu and time-label helpers.

This PR moves that code as-is into sidebar/SidebarThreadRow.tsx. Nothing changes in behavior or render boundaries: the code is the same, and the React Compiler still compiles both files with 0 bailouts.

beforeafter
Sidebar.tsx5,108 lines3,483 lines
sidebar/SidebarThreadRow.tsx—1,675 lines

Renders are unchanged because nothing moved across a subscription boundary. The render win is in the top layer of this stack.

Tests run:

  • vp test run src/reactCompilerCoverage.test.ts -t idebar
  • Sidebar.logic.test.ts
  • Sidebar.drag.test.ts
  • 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): the sidebar's thread rows live in their own file12757e8
Synced from GitHub

Approvability

Verdict: Approved at 12757e8

Macroscope's review found this PR approvable — The PR extracts existing sidebar thread-row implementations and their helpers into a dedicated module while preserving the existing callers and behavior. It introduces no new user-facing capability, product default, schema, deployment, or static-analysis configuration change.

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: ec15df98-e748-430a-af6c-7dad739a6434
📥 Commits

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

📒 Files selected for processing: 2
  • apps/web/src/components/Sidebar.tsx
  • apps/web/src/components/sidebar/SidebarThreadRow.tsx

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

📝 Walkthrough

Sidebar thread-row helpers and components move into SidebarThreadRow.tsx. Sidebar.tsx removes their local implementations and wires the sidebar to the extracted APIs.

Changes: Sidebar thread rows

Layer / File(s)Summary
Shared row support
apps/web/src/components/sidebar/SidebarThreadRow.tsx
Adds provider-entry data, time and provider helpers, tooltip and snooze UI, and sortable-row contracts.
Thread-row behavior and rendering
apps/web/src/components/sidebar/SidebarThreadRow.tsx, apps/web/src/components/Sidebar.tsx
Adds thread-row status and operation logic, drag-and-drop behavior, slim and card rendering, and a diff helper that returns null. Removes corresponding local helpers and row code from Sidebar.tsx.
Search rows and Sidebar wiring
apps/web/src/components/sidebar/SidebarThreadRow.tsx, apps/web/src/components/Sidebar.tsx
Adds the search-result row. Removes its local implementation and related declarations from Sidebar.tsx, which imports the extracted components, constants, and types.

Priority: ⬇️ Low

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Refactor

Suggested reviewers: maria-rcks

Merge Risk: ⚪ Minimal · up to 12757

This refactor moves the sidebar thread row code into its own file without intended behavior change. 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 change and lists verification steps, but it does not provide the required Problem or Scope and approval sections. It also does not include before-and-after screenshots req…Add the required Problem section with expected behavior and reproduction or environment details. Add the Scope and approval section with the triaged issue, maintainer approval, or a valid exemption rationale. Add before-and-after screenshot…
Passed Passed checks: 3 passed
Check nameStatusExplanation
Title checkPassedThe title clearly describes the main change: moving the sidebar thread rows into a separate file. It is concise and uses a valid conventional commit format.
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 change and lists verification steps, but it does not provide the required Problem or Scope and approval sections. It also does not include before-and-after screenshots required for a UI change.

Resolution

Add the required Problem section with expected behavior and reproduction or environment details. Add the Scope and approval section with the triaged issue, maintainer approval, or a valid exemption rationale. Add before-and-after screenshots, and include a recording if interaction details require it. Confirm and correct the reported test command if -t idebar is a typo for -t sidebar. Store no PR-only assets in the repository.

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