feat(desktop): right-side file panel — Source/Diff/History + tabs + resize (#11)#145
Merged
Conversation
…esize (#11) Implements the §3.11 file panel (Mac client). Inserts a 4th grid column between the chat stream and the 48px inspector rail (the inspector stays a rail while a file is open). - FilePanel.tsx — pure presentational component: multi-file tab bar (close ×, unsaved yellow dot), Source/Diff/History view switcher, Source (line-numbered read-only), Diff (inline +/- and side-by-side split, ⌘\ toggles), History (session version timeline), and a left-edge resize grip. - file-panel-reducer.ts (+ 9 unit tests) — pure tab/view/width state machine. - use-file-panel.ts — wraps the reducer with file reads (tool_read), width persistence (localStorage, 320–800px), and the ⌘O / ⌘[ / ⌘] keybindings. - App.tsx — renders the panel + the .file-open grid track, the resize drag, and makes ⌘\ context-sensitive (diff split/inline when a diff is showing, else the inspector toggle). Inspector "Recent files" rows now open into the panel. - tauri-api.ts — toolRead() wrapper over the unscoped tool_read command. Verified visually via a dev-only vite preview harness (src/preview.html, not in the prod bundle) screenshotted across all three views. Diff/History render from data the parent supplies; the snapshot-backed wiring (so Edit/Write populate them) + the click-a-file-in-chat trigger land in a follow-up — honest empty states meanwhile. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
flex-shrink: 0 so the panel keeps its set width (320–800px) in any flex context; the real app's grid `auto` track already sizes to it, this also makes the standalone preview harness respect the width. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Implements the §3.11 right-side file panel (Mac client) — the last GUI item from the gap analysis.
What
A 4th grid column that inserts between the chat stream and the 48px inspector rail (the inspector stays a rail while a file is open).
FilePanel.tsx— pure presentational component:⌘\toggles)file-panel-reducer.ts(+ 9 unit tests) — pure tab/view/width state machine.use-file-panel.ts— wraps the reducer with file reads (tool_read), width persistence (localStorage, clamped 320–800px), and⌘O/⌘[/⌘]keybindings.App.tsx— renders the panel + the.file-opengrid track + the resize drag, and makes⌘\context-sensitive (diff split/inline when a diff is showing, else the inspector toggle). Inspector "Recent files" rows now open into the panel.Verification
The component was verified visually across all three views via a dev-only vite preview harness (
src/preview.html— excluded from the prod bundle). The reducer is unit-tested; typecheck + the desktop build are green.To try it in
tauri dev: press ⌘O to open any file → it appears in the panel with Source/Diff/History tabs; drag the left edge to resize; ⌘[ / ⌘] switch tabs; in Diff view *⌘* toggles split/inline.Follow-up (noted, not in this PR)
Diff/History render from data the parent supplies but it's currently empty (honest empty states). The snapshot-backed wiring — so
Edit/Writepopulate Diff/History from~/.deepcode/sessions/<sid>/snapshots/— plus the click-a-file-in-chat trigger, land next.🤖 Generated with Claude Code