Skip to content

feat(desktop): right-side file panel — Source/Diff/History + tabs + resize (#11)#145

Merged
oratis merged 2 commits into
mainfrom
feat/desktop-file-panel
Jun 1, 2026
Merged

feat(desktop): right-side file panel — Source/Diff/History + tabs + resize (#11)#145
oratis merged 2 commits into
mainfrom
feat/desktop-file-panel

Conversation

@oratis
Copy link
Copy Markdown
Owner

@oratis oratis commented Jun 1, 2026

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:
    • multi-file tab bar (close ×, unsaved yellow dot)
    • Source view (line-numbered, read-only)
    • Diff view (inline +/- and side-by-side split; ⌘\ toggles)
    • History view (session version timeline)
    • 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, clamped 320–800px), and ⌘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.

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/Write populate Diff/History from ~/.deepcode/sessions/<sid>/snapshots/ — plus the click-a-file-in-chat trigger, land next.

🤖 Generated with Claude Code

oratis and others added 2 commits June 2, 2026 00:30
…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>
@oratis oratis merged commit e6c8d36 into main Jun 1, 2026
3 checks passed
@oratis oratis deleted the feat/desktop-file-panel branch June 1, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant