Skip to content

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

Closed

Description

@bencode

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 check

Refs

Activity

  1. added
    enhancement
    source:scheduled
    on Oct 22, 2026
  2. bencode commented on Oct 22, 2026

    @bencode
    OwnerAuthor

    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:scheduled proposals. Audited against main@ebb0ee0.

    Evidence audit: every citation confirmed to the exact line, including the full rescue chain.

    Sensor: lint ✓; verify ✗ on main (anchor red) → stays open. The anchor is deliverable-shaped: both proposal branches (separate count + callout, or export under Attachments/) 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 remembered FolderExportRecord.savedFiles both operate on the flat files-only list, and attachment paths may collide with library paths; an Attachments/ 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.

  3. bencode commented on Oct 24, 2026

    @bencode
    OwnerAuthor

    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 hit workspace-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 on exporter.supported && fileCount > 0.
    • features/resources/use-file-export.ts:73-75 — the exporter's files filter is (file.collection ?? 'files') === 'files', so no attachment is ever written; resource-panel.tsx:109 — attachments come from the same library.files; file-row.tsx:104-115 — per-row Save as… remains an attachment's only path out.
    • The mismatch stands as filed: the dialog counts what the rescue does not save, and an attachments-only project shows "deletes 2 files" while the rescue saves zero.

    Sensor: lint passed; verify failed — 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementsource:scheduled

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions