Repository navigation
Description
Problem
An attached document is stored in the project's library (use-file-library.ts:145-156, collection attachments) yet can never join it. Every path to disk excludes the collection: source Save plans only collection === 'files' (use-source-sync.ts:63-65,194,221,232), and Save to folder writes the Files tree, with attachments leaving one by one through Save as… — the exclusion #225 settled that way. The one place the product says so is the delete dialog, at the moment of no return: "Save to folder first leaves attachments out; save each one with Save as… in Files." (delete-project-dialog.tsx:39-41,57-62). Before that day, nothing says it: the Attachments group under Files (resource-panel.tsx:327-340) carries no note, the source-sync line counts files only, and the attachment row's actions (file-row.tsx:82-125) are Reference, Star, Save as…, Remove — no way into the library. So a reader who attaches a PDF, finds it matters, and works in a local working-tree project (README: "Save above Files writes to disk") presses Save for weeks while the attachment never reaches the folder; the round trip the product offers — Save as… to the computer, then Add files… to re-import — sends a file already in the browser out through the operating system and back. Two tiers, no bridge, in a product whose anti-reference is "one clear interaction model" for files the reader holds.
Proposal
- Give the attachment row a Keep in Files action (
file-row.tsx:82-125): it moves the stored file fromattachmentstofiles— a metadata change; the bytes never move — after which the document joins the Files tree, syncs and source-saves like any file. - Let the Attachments group header carry the standing sentence the delete dialog already knows: attachments stay in this browser; Keep in Files moves one into the library (
resource-panel.tsx:327-340). - Save as… keeps its role of taking one copy to disk; nothing else changes.
Goal
After this, a reader who decides an attached document matters can promote it where it lives: it becomes a library document, reaches the folder or repository Save writes, and no stored document needs a trip through the operating system to change tiers — while attachments that stay attachments are told what they are before deletion day, not at it.
Verification
grep -rEqi "Keep in Files" ui-packages/web/src/features/resources
pnpm --filter @gamma-reader/web test --silent
pnpm checkRefs
- ui-packages/web/src/features/resources/use-file-library.ts:145-156 — attachments import into their own collection
- ui-packages/web/src/features/source/use-source-sync.ts:63-65,194,221,232 — every save path filters to collection
files - ui-packages/web/src/features/projects/delete-project-dialog.tsx:39-41,57-62 — the only place the exclusion is said, phrased for Save to folder
- ui-packages/web/src/features/resources/file-row.tsx:82-125 — the attachment row: no action reaches the library
- ui-packages/web/src/features/resources/resource-panel.tsx:327-340 — the Attachments group, no note
- ui-packages/web/PRODUCT.md — "one clear interaction model" for included and added files
- Let Save to folder write chat attachments out with the files — today each one leaves only one by one, through Save as… #225 — settled the export side with per-file Save as…; this gives the library side its own path
- Say at project deletion what the rescue saves — the dialog counts attachments among the files it deletes, while Save to folder first writes only the Files tree #183 — named the exclusion at deletion; this names it while the attachment still exists
- Move or copy documents between projects inside the browser — a mis-filed document is locked today #47 — moving between projects; this is moving between the library's two tiers
Activity
bencode commentedon Oct 29, 2026
Posted by the scheduled issue-reviewer loop, independent of the authoring session.
Audit at d05b6b6 — valid, stays open.
Evidence check — every anchor verified:
ui-packages/web/src/features/resources/use-file-library.ts:145-156—addAttachmentsimports with collection'attachments'.ui-packages/web/src/features/source/use-source-sync.ts:63-65—inLibraryfilters(file.collection ?? 'files') === 'files'; every save path runs through it (libraryFiles()at the sync/save call,files.filter(inLibrary)for pending state) — no path reaches theattachmentscollection.ui-packages/web/src/features/projects/delete-project-dialog.tsx:57-62— "Save to folder first leaves attachments out; save each one with Save as… in Files.", verbatim, exactly where cited.ui-packages/web/src/features/resources/file-row.tsx:82-125— the row's actions are Reference, Star, Save as…, Remove; no library-join path.ui-packages/web/src/features/resources/resource-panel.tsx:327-340— the Attachments group is a heading plus tree, no note.Duplicate check (open + closed): none. On the #225 relationship: #225 was closed not-planned with the rationale that Save to folder must not mix one-off uploads into the working folder. This proposal does not reopen that decision — Keep in Files is per-attachment and explicit, the promoted file joins the
filescollection by the reader's own act, and Save then writes it as any library file. The boundary #225 drew (no automatic inclusion) is preserved; the OS round trip is what goes. Worth keeping that framing visible when this is implemented, so it is not mistaken for a #225 relitigation.Sensor: lint ✓; verify ✗ — fails at the
grep "Keep in Files"step, correctly failing while unimplemented.Sharpening:
collectionis a metadata field (file.collectionreads inuse-source-sync.ts:63), so promotion is a metadata write plus library reload.file-row.tsxfor the action, one againstresource-panel.tsxfor the note.bencode commentedon Nov 1, 2026
Posted by the scheduled issue-reviewer loop, independent of the authoring session.
Re-audit at d05b6b6 — valid, stays open (HEAD unchanged since the first review).
use-file-library.ts:145-156); every save path still filters tocollection === 'files'(use-source-sync.ts:63-65and thelibraryFiles()/files.filter(inLibrary)call sites); the delete dialog is still the only place the exclusion is said (delete-project-dialog.tsx:57-62); the attachment row still offers Reference / Star / Save as… / Remove only (file-row.tsx:82-125); the Attachments group still carries no note (resource-panel.tsx:327-340).grep "Keep in Files"gate — correctly failing while unimplemented.Verdict unchanged; the two-surface anchor from the first review (action in
file-row.tsxand note inresource-panel.tsxseparately) still stands for whoever implements.bencode commentedon Nov 6, 2026
Posted by the scheduled issue-reviewer loop, independent of the authoring session.
Re-audit at d05b6b6 (HEAD unchanged since 2026-11-01) — valid, stays open.
use-file-library.ts:145-156,'attachments'); every save path still filterscollection === 'files'(use-source-sync.ts:63-65); the exclusion is still said only in the delete dialog (delete-project-dialog.tsx:57-62, verbatim); the attachment row still offers Reference / Star / Save as… / Remove only (file-row.tsx:82-125).Keep in Filesgate — correctly failing while unimplemented.Verdict unchanged; the two-surface verification anchor from the first review (action in
file-row.tsx, note inresource-panel.tsx, grepped separately) still stands for whoever implements.bencode commentedon Nov 10, 2026
Posted by the scheduled issue-reviewer loop, independent of the authoring session.
Re-audit (fourth pass) @
d05b6b6— valid, stays open. HEAD unchanged since 2026-10-28; no commit, PR, or issue in any state has appeared since the 11-06 third pass.use-file-library.ts:145-156(addAttachments→'attachments');use-source-sync.ts:63(inLibraryfilterscollection === 'files') with the three save call sites at:194/:221/:232all routing through it;delete-project-dialog.tsx:57-62(the exclusion sentence, verbatim, both variants);file-row.tsx:82-125(Reference / Star / Save as… / Remove, nothing else);resource-panel.tsx:327-340(Attachments group = heading + tree, no note). Supporting claims also re-checked:PRODUCT.md:31("one clear interaction model") andREADME.md:26("Save above Files writes to disk").Keep in Filesgate — direct grep confirms the phrase is absent fromfeatures/resources/, so the block still discriminates correctly.file-row.tsxand the group note inresource-panel.tsxseparately) still stands for whoever implements.bencode commentedon Nov 13, 2026
Posted by the scheduled issue-reviewer loop, independent of the authoring session.
Re-audit (fifth pass) @
d05b6b6— valid, stays open. HEAD unchanged since 2026-10-28; nothing new filed or merged since #295 (2026-11-05) — open PRs #287 and #293 touch neither surface.addAttachmentsstill imports into'attachments'(use-file-library.ts:145-156); every save path still filters(file.collection ?? 'files') === 'files'(use-source-sync.ts:63,libraryFiles()beside it); the exclusion is still said only in the delete dialog, both variants verbatim (delete-project-dialog.tsx:57-62); the attachment row still offers Reference / Star / Save as… / Remove only (file-row.tsx:82-125); the Attachments group is still heading + tree with no note (resource-panel.tsx:327-340).Keep in Filesgate — direct grep confirms the phrase is still absent fromfeatures/resources/, so the block discriminates correctly while unimplemented.file-row.tsxand the group note inresource-panel.tsxseparately) still stands.