Skip to content

feat(x): Files panel for chats, in-app PDF viewing, file card redesign - #829

Open
Gagancreates wants to merge 1 commit into
mainfrom
feat/chat-files-panel
Open

feat(x): Files panel for chats, in-app PDF viewing, file card redesign#829
Gagancreates wants to merge 1 commit into
mainfrom
feat/chat-files-panel

Conversation

@Gagancreates

Copy link
Copy Markdown
Collaborator

What

Claude-style "Files" experience for chats: see every file/doc the agent created in the current chat at a glance, open PDFs inside Rowboat, and cleaner file cards.

Files panel

  • lib/session-files.ts — pure derivation of the chat's files from two sources: completed file-writing tool calls (file-writeText / editText / copy / rename follows the file / remove drops it / code_agent_run changedFiles anchored to cwd), and ```filepath fences in assistant messages (the same fences that render inline cards — this is how shell-generated files like PDFs surface). Deduped by path; tmp/ scratch files filtered.
  • components/chat-files-panel.tsx — right-hand panel (mirrors version-history-panel's shell) listing each file as a FilePathCard.
  • Header button — a Files icon with a count badge appears in the chat header once the chat has ≥1 file. Wired in both the full-screen chat (side-by-side panel) and the side-pane chat (full-pane overlay — the pane is too narrow for a split). Shared open/close state.

In-app PDF viewing

  • Clicking Open on a PDF card routes to the existing file-view flow (file tab + PdfFileViewer, chat docks to the side pane) instead of the OS viewer.
  • PdfFileViewer now also handles absolute/~ paths (e.g. agent-saved Desktop PDFs) by loading through shell:readFileBase64 into a blob URL — the app://workspace protocol is boundary-guarded and can't serve them. Files over the 10MB IPC cap fall back to the existing "Open in system" state.
  • Fixed a navigateToView no-op: re-navigating to the already-open file from a maximized chat pane now un-maximizes so the file becomes visible.

File card redesign

  • FilePathCard gets a document-page glyph (folded corner, extension label color-accented by type) instead of generic lucide icons, tighter typography, hover polish, and a hover-revealed "Reveal in Finder" action. Full-width as before.

Notes

  • Renderer-only; no IPC or schema changes. npm run typecheck passes.
  • Known gap: files written by sub-agents (spawn-agent child turns) aren't in the parent conversation, so they don't appear in the panel yet — needs per-child-turn transcript fetches as a follow-up.

🤖 Generated with Claude Code

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