Split reviews-sidebar.tsx into focused sibling components - #839
Merged
Conversation
Pure structural refactor: reviews-sidebar.tsx (685 lines) becomes a thin ReviewsSidebarContent shell (100 lines), with ReviewRow + status styles moved to reviews-sidebar-row.tsx (270) and FeedbackItemRow + ThreadMessage + path helpers moved to reviews-feedback-item.tsx (326). No behavior change. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Pure structural refactor of
apps/web/src/components/app/reviews-sidebar.tsx(685 lines), the largest unworked candidate on the componentizer backlog. No behavior, markup, or styling changes — components moved whole with their hooks, so mount lifetimes are unchanged.New file structure
reviews-sidebar.tsx(685 → 100 lines) — now just theReviewsSidebarContentshell: review list query,expandReviewURL state, diff-file-path set, and empty/loading states. Public API unchanged (media-sidebar.tsxand the test file keep their imports).reviews-sidebar-row.tsx(270 lines, new) —ReviewRowwith its sticky-header pinning + scroll-into-view effects, plus theREVIEW_STATUS_STYLESconstants.reviews-feedback-item.tsx(326 lines, new) —FeedbackItemRow(expand/reply/resolution state) with privateThreadMessageand theformatFilePath/compactFilePath/feedbackStatehelpers, which only it used.Why it was a candidate
835 lines at last audit (685 after PRs #836/#837 extracted the shared feedback-card parts) — four components plus helpers in one file, well over the ~300-line guideline.
Validation
pnpm run finalize:webgreen;reviews-sidebar.test.tsx(6 tests) green;pnpm run test:e2egreen (170 passed).Queued next
diff-annotations.tsx(741 lines) — compound-component split, one file per exported annotation component.🤖 Generated with Claude Code