Repository navigation
Description
Problem
Deleting a project is the app's most destructive action, and its dialog counts honestly: "This deletes N files and M conversations kept in this browser" (ui-packages/web/src/features/projects/delete-project-dialog.tsx:39-41), where N is library.files.length passed unfiltered from the workbench (ui-packages/web/src/shell/workbench.tsx:183) — attachments included, since they live in the same library (ui-packages/web/src/features/resources/resource-panel.tsx:109). The rescue the same dialog offers, Save to folder first (ui-packages/web/src/features/projects/delete-project-dialog.tsx:47-56), runs the folder exporter, which filters to collection === 'files' and never writes an attachment (ui-packages/web/src/features/resources/use-file-export.ts:73-76). Attachments have no batch path out — only per-row Save as… (ui-packages/web/src/features/resources/file-row.tsx:104-115).
So with 3 library files and 2 chat attachments, the dialog says "This deletes 5 files", Save to folder first writes 3, announces "3 files saved", and Delete destroys the 2 attachments — nothing ever names them or says they were left out. A project holding only attachments is the sharpest case: the dialog says "This deletes 2 files", the rescue saves zero, and Delete still destroys both. PRODUCT.md asks the app to "explain the few actions that affect persistence"; this is the one moment where everything is at stake and the copy overstates what the offered rescue covers.
Proposal
- In the delete dialog, count attachments separately: "This deletes 5 files and 2 attachments…" — the concept already exists as the Attachments group in Files.
- Say what the rescue covers: either state that Save to folder first saves the project's files while attachments need Save as… one by one, or include attachments in the folder export under an
Attachments/folder so the rescue matches the count.
Goal
After this, the delete-project dialog's count and its rescue agree: every category the dialog names as kept in this browser is either saved by Save to folder first or explicitly called out as not saved, before Delete is chosen.
Verification
grep -rqi "attachment" ui-packages/web/src/features/projects/delete-project-dialog.tsx
pnpm --filter @gamma-reader/web test --silent
pnpm checkRefs
- ui-packages/web/src/shell/workbench.tsx:183 — fileCount passed to the dialog includes attachments
- ui-packages/web/src/features/projects/delete-project-dialog.tsx:39-41, 47-56 — the count, and the rescue that does not cover it
- ui-packages/web/src/features/resources/use-file-export.ts:73-76 — folder export filters to the files collection
- ui-packages/web/src/features/resources/resource-panel.tsx:109 — attachments live in the same library they are counted from
- ui-packages/web/src/features/resources/file-row.tsx:104-115 — Save as…, the only path out for an attachment
- ui-packages/web/PRODUCT.md — "Keep document data local by default and explain the few actions that affect persistence"
- Give conversations an export path — weeks of questions and answers live and die with the browser profile #50 — conversations were counted in this same dialog and denied a dedicated export (declined: the assistant can write them up); attachments are documents, and this issue asks for honest counting and coverage, not a new export surface
- Say why Save to folder is greyed out — on Safari and iOS the control is disabled, and its only explanation is a hover tooltip touch screens never show #176 — the same dialog's rescue is hidden on Safari/iOS without a word; this issue is about what the visible rescue claims to cover
- Binary files overpromise at every layer — a stored .doc previews as 'usable as context', lists as textReadable, then read fails with encoding advice #162 — attachments' format promises; this is their persistence promise
Activity
bencode commentedon Oct 22, 2026
Independent review — posted by the scheduled issue-reviewer loop (a session separate from the one that files these issues), under the maintainer's standing instruction to evaluate, sharpen, or retire
source:scheduledproposals. Audited againstmain@ebb0ee0.Evidence audit: every citation confirmed to the exact line, including the full rescue chain.
workbench.tsx:183(fileCount={library.files.length}, unfiltered) →project-switcher.tsx:225→delete-project-dialog.tsx:39-41("This deletes N files and M conversations kept in this browser").resource-panel.tsx:109filterslibrary.filesbycollection === 'attachments'.useFileExportmemoizesfiles = allFiles.filter(collection === 'files')(:73-75) andsaveToFolder→saveFiles→writeStoredFiles(directory, files)(:114-146) never sees an attachment; the announcement at:158counts only the filtered list — "3 files saved to X" while the dialog said 5, exactly as claimed. The attachments-only case is even sharper than the issue states: the button shows (fileCount > 0counts attachments,:47) and the announcement reads "0 files saved to X."file-row.tsx:104-115— per-row Save as… is confirmed the only attachment exit.Sensor:
lint✓;verify✗ on main (anchor red) → stays open. The anchor is deliverable-shaped: both proposal branches (separate count + callout, or export underAttachments/) require the word in the dialog's copy.Sharpening: if option B (export attachments) is chosen, thread them through conflict detection too —
findDirectoryConflicts(directory, files, savedFiles)and the rememberedFolderExportRecord.savedFilesboth operate on the flat files-only list, and attachment paths may collide with library paths; anAttachments/prefix has to hold in all three places, not just the write.Verdict: valid, keep open. No commit implements or invalidates it; both sensor gates behave correctly.
bencode commentedon Oct 24, 2026
Re-audit — posted by the scheduled issue-reviewer loop, independent of the authoring session. (Signal check: marker-only comments, no reactions, no assignee.)
Delta since last review (2026-10-22T22:16Z →
90b046f): 7 merges landed, none touching this issue's files (tab-drag hitworkspace-store/tab-bar; the rest were conversation/composer/docs/styles.css). The count/rescue mismatch is untouched.Evidence audit (main @
90b046f) — all anchors exact, no drift:shell/workbench.tsx:183—fileCount={library.files.length}, unfiltered, attachments included;features/projects/delete-project-dialog.tsx:39-41— the count sentence;:47-56— the Save-to-folder-first rescue, gated only onexporter.supported && fileCount > 0.features/resources/use-file-export.ts:73-75— the exporter'sfilesfilter is(file.collection ?? 'files') === 'files', so no attachment is ever written;resource-panel.tsx:109— attachments come from the samelibrary.files;file-row.tsx:104-115— per-row Save as… remains an attachment's only path out.Sensor:
lintpassed;verifyfailed — the dialog still never mentions attachments.Sharpening: the Verification greps the word "attachment" in the dialog file; that pins the copy-only option. If the fix goes the other way (include attachments in the folder export under
Attachments/), anchor instead on count/rescue agreement — e.g. a test asserting the exporter's saved count equals the dialog's stated count.Verdict: valid — stays open.