Vendor shared file tree + resizable picker from monorepo#63
Open
dastratakos wants to merge 1 commit into
Open
Conversation
Syncs the CLI's file picker / chapter sidebar with the monorepo overhauls that landed after the fork: - #980: extract a single shared FileTree (+ FileFilterInput) rendered by both the Files-changed picker and the chapter detail sidebar. Replaces the chapter sidebar's flat FileViewRow list and the file picker's own inlined tree reimplementation. - #984: order the collapsed picker indicators by file-tree order rather than raw API order. - #985: add a shared useResizablePanel hook + chapter-panel-constants; CollapsiblePicker gains an opt-in resize handle and the chapter side panel drops its hand-rolled drag logic for the hook. Adaptations for the CLI: imports rewritten to @/lib/*; FILE_VIEWED_STATE moved into lib/diff-types; comment counts are absent so callers pass an empty map; CollapsiblePicker drops the command-board event the CLI lacks. file-view-row.tsx is deleted (its last consumer, the chapters index page, now renders a small local FilePathRow). Typecheck, lint, test (299), and build all pass.
|
Ready to review this PR? Stage has broken it down into 8 individual chapters for you: Chapters generated by Stage for commit f02bf49 on Jun 2, 2026 4:47am UTC. |
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
Syncs the CLI's file picker and chapter detail sidebar with the monorepo file-tree overhauls that landed after the CLI was forked (~May 27). Brings the CLI up to the shared file tree architecture and the resizable panel hook.
Ports three monorepo PRs:
FileTree(+FileFilterInput) rendered by both the Files-changed picker and the chapter detail sidebar. Previously the CLI's chapter sidebar used a flatFileViewRowlist and the file picker had its own inlined tree reimplementation — two divergent copies, now one.useResizablePanelhook +chapter-panel-constants;CollapsiblePickergains an opt-in resize handle and the chapter side panel drops its hand-rolled drag logic.Changes
lib/use-resizable-panel.ts,components/chapter/chapter-panel-constants.ts,components/files/file-tree.tsx,components/files/file-filter-input.tsx(vendored from the monorepo, imports adapted to@/lib/*).file-picker.tsx(thin wrapper overFileTree),chapter-file-list.tsx(rendersFileTreeinstead of a flat list),collapsible-picker.tsx(internal collapse state +shortcutKey+resize+ShortcutTooltip),chapter-side-panel.tsx(usesuseResizablePanel).components/chapter/file-view-row.tsx— its last consumer (the chapters index page) now renders a small localFilePathRow.FILE_VIEWED_STATEmoved intolib/diff-types; comment counts are absent so callers pass an empty map;CollapsiblePickerdrops the command-board event the CLI lacks. The chapter sidebar now passesfocusedFilePathso the tree highlights the active file.Testing
pnpm typecheck✅pnpm lint✅ (clean, no warnings)pnpm test✅ 299/299pnpm build✅Summary by cubic
Ports the monorepo’s shared file tree and resizable panel to the CLI, unifying the file picker and chapter sidebar. This removes duplicate implementations and adds filtering, resize, and consistent ordering.
New Features
FileTreeandFileFilterInputused by the file picker and chapter sidebar; highlights the focused file and supports “viewed” toggles.CollapsiblePickergains opt-in resize viauseResizablePanel, keyboard shortcut toggle, and hover preview that respects the resized width.Refactors
useResizablePaneland sharedchapter-panel-constants; removes custom drag logic.FILE_VIEWED_STATEmoved to@/lib/diff-types; CLI passes an empty comment-count map; drops command-board event.file-view-row.tsxremoved; chapters index now renders a small localFilePathRow.Written for commit f02bf49. Summary will update on new commits.