refactor(desktop): split sidebar/index.tsx god file into focused modules - #55453
Merged
Conversation
Behavior-preserving extraction of the 1,963-line ChatSidebar file into the existing sidebar/ sibling-module convention: - order.ts: add pure orderByIds / reconcileOrderIds / sameIds helpers (+ tests) - reorderable-list.tsx: the generic ReorderableList + useSortableBindings DnD primitive - section-states.tsx: SidebarSessionSkeletons / SidebarBlankState / SidebarPinnedEmptyState - sessions-section.tsx: SidebarSectionHeader + the large SidebarSessionsSection renderer + its sortable row wrappers index.tsx now holds only the ChatSidebar component (1,963 -> 1,416 lines).
tonydwb
reviewed
Jun 30, 2026
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary\n\nVerdict: LGTM\n\nSecond in the desktop god-file split series. sidebar/index.tsx reduced from 1,963 to 1,416 lines. 6-file change with clean module boundaries and 10 unit tests for order helpers.\n\n### Looks Good\n- Pure restructuring with no behavior change\n- Acyclic module dependencies\n- Comprehensive test coverage for the reorder helpers\n---\nReviewed by Hermes Agent
tonydwb
reviewed
Jun 30, 2026
tonydwb
left a comment
There was a problem hiding this comment.
Code Review: LGTM
Splits the sidebar index.tsx god file into focused modules: ReorderableList, orderByIds, reconcileOrderIds, sameIds moved to order.ts; SidebarSectionHeader, SidebarSessionSkeletons, SidebarBlankState, SidebarPinnedEmptyState moved to section-states.ts; SidebarSessionsSection moved to sessions-section.ts. This is a classic god-file reduction -- the parent component is now a clean orchestrator. File count (6) and additions (608) are well within scope for a structural refactor.
Verdict: LGTM -- clean decomposition of a god file.
1 task
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
…lit-sidebar refactor(desktop): split sidebar/index.tsx god file into focused modules
habarmc1223-sudo
pushed a commit
to habarmc1223-sudo/hermes-agent-fluxmem
that referenced
this pull request
Jul 8, 2026
…lit-sidebar refactor(desktop): split sidebar/index.tsx god file into focused modules
santhreal
pushed a commit
to santhreal/hermes-agent
that referenced
this pull request
Jul 13, 2026
…lit-sidebar refactor(desktop): split sidebar/index.tsx god file into focused modules
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
…lit-sidebar refactor(desktop): split sidebar/index.tsx god file into focused modules
leewenjie
pushed a commit
to leewenjie/hermes-agent
that referenced
this pull request
Aug 7, 2026
…lit-sidebar refactor(desktop): split sidebar/index.tsx god file into focused modules
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 free
to 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.
Summary
Second in the
apps/desktopgod-file split series. Breaks the 1,963-linesrc/app/chat/sidebar/index.tsxinto the directory's existing sibling-module convention.index.tsxnow holds only theChatSidebarcomponent: 1,963 → 1,416 lines.Changes
order.ts— adds the pure reorder helpersorderByIds,reconcileOrderIds,sameIdsalongside the existing ones (+ unit tests inorder.test.ts)reorderable-list.tsx(new) — the genericReorderableList+useSortableBindingsDnD primitive (and its Y-only auto-scroll constant)section-states.tsx(new) —SidebarSessionSkeletons,SidebarBlankState,SidebarPinnedEmptyStatesessions-section.tsx(new) —SidebarSectionHeader, the largeSidebarSessionsSectionrenderer, and theSortable*row wrappersNotes
order/reorderable-list/section-statesare leaves;sessions-sectiondepends on them + the existingprojects/session-row/virtual-session-list;index.tsxcomposes everything.ChatSidebaris exported unchanged; its single consumer's import path is untouched.Test plan
npm run typecheck(desktop) — passeseslinton all changed/added files — cleanvitest runfororder.test.ts(existing + new helper tests) — 10 passNote: a whole-tree
npm run lintreports 4 pre-existing errors in unrelated files onmain; none are touched here.