feat: multi-format file attachments with @-mentions and preview renderers#12
Merged
OmGuptaIND merged 1 commit intomainfrom Apr 24, 2026
Merged
feat: multi-format file attachments with @-mentions and preview renderers#12OmGuptaIND merged 1 commit intomainfrom
OmGuptaIND merged 1 commit intomainfrom
Conversation
…rers Extend the composer beyond image-only attachments. Users can now upload documents (pdf, docx, doc, rtf), spreadsheets (xlsx, xls, csv, tsv), and text (md, txt, log, json) directly from the composer or Files view, reference any file or folder in the project via `@`, and preview them inline in the artifact panel. The harness translates markers to absolute-path XML refs so the agent can read the files on demand via its existing `read` / `bash` tools. Why: images were the only first-class attachment. Anyone trying to "give the agent this PDF" had to upload via the Files view, then type the path. The new flow makes uploads project-native (any format, any folder) and references discoverable via `@` with shell-style drill-in. UI - Composer `+` menu splits into Add Images / Add Files - DestinationPicker modal for per-upload folder + rename, with macOS-style folder create, batch mode, smart defaults per mime family (data → /data, pdf → /references, …), recent-folder memory - `@` dropdown with files + folders, Finder-style drill-in (click chevron or →), back-navigation row for parent scope, keyboard nav - File / folder pills in composer with inline icon, hover-reveal remove (×), click to open artifact panel (file) or Files view (dir) - All three floating UIs portaled into document.body so transforms on composer ancestors don't break fixed positioning - Session Files bar splits into Uploads + Artifacts sections Rendering - Artifact panel gains docx (mammoth), xlsx (SheetJS), pdf (<embed>), image (<img>) renderers, all lazy-loaded - fs_read_bytes IPC primitive for binary-file fetch with 500MB cap - MessageBubble renders [img:id] / [file:path] / [dir:path] markers in sent messages as clickable chips Harness - translateFileDirMarkers expands [file:path] / [dir:path] markers into <file_ref name path> / <dir_ref> XML with absolute paths and optional inline folder listings (≤20 items) - Workspace path threaded into buildInterleavedContent at both call sites (processMessage + steer) Infra - cloud-init installs poppler-utils, pandoc, python3-pandas, python3-openpyxl, xlsx2csv on the VM so the agent can read docs via its existing shell / read tools Protocol additive - fs_list_response echoes requested path for listener correlation - fs_read_bytes / fs_read_bytes_response for binary artifact previews Specs - specs/features/MULTI_FORMAT_ATTACHMENTS.md (design doc) - specs/features/MULTI_FORMAT_ATTACHMENTS_FOLLOWUPS.md (known follow-ups: a11y nits, sequential batch decode perf, viewport clamping on dropdowns) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
OmGuptaIND
added a commit
that referenced
this pull request
Apr 24, 2026
### Features - multi-format file attachments with @-mentions and preview renderers (#12) ### Fixes - pnpm lock - workspace safety net — no more /root EACCES, atomic writes, version handshake (#11) ### Chores - clean up biome lint + format across repo ### Other - feat(desktop): remove new-project attachments, add text-file creator in files view (#10) - feat(desktop): reasoning effort pill + provider modal redesign + onboarding tour (#9) - fix(desktop): honor real harness readiness in provider UI (#8) - fix(harness): persist session title to meta.json across reloads (#7)
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
Extend the composer beyond image-only attachments. Users can now upload documents (pdf, docx, doc, rtf), spreadsheets (xlsx, xls, csv, tsv), and text (md, txt, log, json) directly from the composer or Files view; reference any file or folder in the project via
@with shell-style drill-in; and preview uploads in the artifact panel (docx / xlsx / pdf / image). The harness translates markers to absolute-path<file_ref>/<dir_ref>XML so the agent canread/bashthem on demand.Spec:
specs/features/MULTI_FORMAT_ATTACHMENTS.mdFollow-ups:
specs/features/MULTI_FORMAT_ATTACHMENTS_FOLLOWUPS.mdUI
+splits into Add Images / Add Files@dropdown with files + folders, Finder-style drill-in (chevron / →), back-navigation row for parent scope, keyboard nav + Backspace to pop a leveldocument.bodyso ancestor transforms don't break fixed positioning[img:id]/[file:path]/[dir:path]markers as clickable chipsRendering
DocxRenderer(mammoth),XlsxRenderer(SheetJS — with working "Show all rows"),PdfRenderer(<embed>),ImageRenderer— all lazy-loadedfs_read_bytesprimitive for binary fetch, 500MB capHarness
translateFileDirMarkersexpands markers into XML refs with absolute paths and shallow folder listings (≤20 items)workspacePaththreaded intobuildInterleavedContentat both call sitesInfra
cloud-initinstallspoppler-utils,pandoc,python3-pandas,python3-openpyxl,xlsx2csvso the agent can process uploaded docs via its shell / read toolsdeploy/DockerfileProtocol (additive)
fs_list_responseechoes requestedpathso concurrent listeners correlate correctlyfs_read_bytes/fs_read_bytes_responsefor binary artifact previewsTest plan
+ Add Images→ pick PNG → inline chip (regression)+ Add Files→ pick.md→ DestinationPicker opens atnotes/→ Save → pill in composer → Files view shows it undernotes/.xlsxonto composer → picker defaults todata/→ Save → pill → click pill → artifact panel renders sheet tabs + table@sal→ dropdown → Enter to select → pill inserted@data/→ dropdown scopes into data/ → ← / Backspace returns to root@email(folder) → Right arrow or chevron → drills in; Enter selects the folder itself<file_ref name path />/<dir_ref>@query🤖 Generated with Claude Code