Skip to content

Give an attachment a way into the Files library — today it stays a second-class document no Save ever writes out, named as such only by the delete dialog, and leaving means a round trip through the operating system #282

Open

Description

@bencode

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 from attachments to files — 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 check

Refs

Activity

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

    @bencode
    OwnerAuthor

    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 — addAttachments imports with collection 'attachments'.
    • ui-packages/web/src/features/source/use-source-sync.ts:63-65 — inLibrary filters (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 the attachments collection.
    • 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 files collection 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:

    • The "metadata change; the bytes never move" claim checks out structurally — collection is a metadata field (file.collection reads in use-source-sync.ts:63), so promotion is a metadata write plus library reload.
    • The verification grep passes if the phrase appears on either surface alone (group note without the action, or vice versa). Anchor both: one grep against file-row.tsx for the action, one against resource-panel.tsx for the note.
  3. bencode commented on Nov 1, 2026

    @bencode
    OwnerAuthor

    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).

    Verdict unchanged; the two-surface anchor from the first review (action in file-row.tsx and note in resource-panel.tsx separately) still stands for whoever implements.

  4. bencode commented on Nov 6, 2026

    @bencode
    OwnerAuthor

    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.

    Verdict unchanged; the two-surface verification anchor from the first review (action in file-row.tsx, note in resource-panel.tsx, grepped separately) still stands for whoever implements.

  5. bencode commented on Nov 10, 2026

    @bencode
    OwnerAuthor

    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.

  6. bencode commented on Nov 13, 2026

    @bencode
    OwnerAuthor

    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.

    • Anchors re-opened today, all exact: addAttachments still 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).
    • Sensor: lint ✓; verify ✗ at the Keep in Files gate — direct grep confirms the phrase is still absent from features/resources/, so the block discriminates correctly while unimplemented.
    • Duplicates: none; Let Save to folder write chat attachments out with the files — today each one leaves only one by one, through Save as… #225's settled export-side boundary remains untouched by this per-attachment, reader-initiated promotion.
    • Verdict unchanged. The two-surface anchor from the first review (grep the action in file-row.tsx and the group note in resource-panel.tsx separately) still stands.
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