Repository navigation
feat(files): add a Files panel with search, previews and file-link chips - #191
Merged
Merged
Conversation
File links in model output had nowhere to go, and hosted instances could not open them at all. The new right-side panel reads files through the Host's existing path checks, so it works the same on every Host. - Finder-style folder view with back/forward, breadcrumb and project-wide name search; files this chat created or changed are marked. - Previews for text/code (binary sniffing, capped head), Markdown, HTML and SVG in a sandboxed frame with embedded images, CSV, images and PDF (lazy pdf.js with HTTP range requests). - Local paths in Markdown (`./a.txt:12`, `/abs`, `file://`, `C:\`, `page.html#anchor`) render as chips that open the preview. - Context menu with Open and, in the desktop app only, Show in file manager. - Toggle (PanelRight) in the title bar, Ctrl/Cmd+Shift+E, resizable and persisted; overlay on mobile. - Backend: `/api/fs/list?files=1`, new `/api/fs/stat`, streamed downloads with optional `OPENGUI_DOWNLOAD_MAX_BYTES` (unset = no limit). - Prompt box re-measures its height when the chat width changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # packages/backend/src/routes/fs.ts # src/App.tsx
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.
Problem
File links in model output had nowhere to go. Paths like
./notes.txt:2or/home/…/report.pdfwere treated as web URLs and resolved against the app's address, and on a hosted instance there was no way to open them at all.What this adds
A right-side Files panel. It reads files through the Host's existing path authorization, so it works the same on desktop, self-hosted and hosted instances.
Browsing
…, and the full name is in a tooltip.Previews
Chat integration
./a.txt:12,/abs/path,file://,C:\…,page.html#anchor) render as chips that open the preview.path:linejumps to that line.http(s)URLs are no longer resolved against the app's own origin.Controls
PanelRighttoggle in the title bar, mirroring the left sidebar button. Shortcut: Ctrl/Cmd+Shift+E.Backend
GET /api/fs/list?files=1also lists files, with size and modification time.GET /api/fs/statreturns name, size, mtime and text-encoding detection.GET /api/fs/file?download=1streams the file as an attachment. There is no limit by default.OPENGUI_DOWNLOAD_MAX_BYTESadds one and is documented indocs/docker.md.GET /api/fs/file?maxBytes=Nreturns a capped head for text previews. PDFs supportRange.nosniff,no-cache). CORS now allows therangeheader and exposes the range headers.Also
Tests
vp check: cleanvp test --run: 256 files, 1671 tests passing. New tests cover the routes (fs.files-panel.test.ts, path enforcement), link parsing and chat-file collection (host-files.test.ts), the Host client, CSV, HTML resource rewriting and the panel.pnpm run slop-check: okscripts/browser-acceptance.ts: full journey passes. It is extended with file links, project search, text/CSV/HTML/PDF previews and mobile focus. It now also waits for the model list in the settings step, which raced the list loading.Adds the dependency
pdfjs-dist. It is lazy-loaded, and the initial bundle stays within the bundle budget.🤖 Generated with Claude Code