Skip to content

PRD: FileDrop — dropping any file on a Terminal hands it to the agent #182

Description

@miakh

What to build

Dropping any file on a Deck Terminal should hand that file to the pane as part of the current prompt instead of opening it in an editor tab or silently losing it.

This deliberately extends the decisions shipped through #176 and #179. A drag carrying local file: URIs keeps the original absolute paths, so source-file identity is preserved. When a Finder, browser, screenshot thumbnail, or other source exposes only browser File objects, Deck acquires every file synchronously and materializes the bytes under the OS temp directory. Losing the original identity is an explicit trade-off for byte-only sources: the webview has no source path to preserve, and the alternative is not delivering the file at all.

Both sources converge into one FileDrop result: one ordered bracketed paste containing every resolved path. The gesture does not submit or execute input, does not mutate the clipboard, and remains independent of whether Deck currently recognizes an agent in the pane. Image MIME mapping may help preserve conventional image extensions, but ImageDrop should no longer be a separate protocol or user-facing concept.

A mixed payload must not discard byte-backed files merely because it also contains an unusable URI such as https: or untitled:. Distinct files must not be deduplicated by coincidentally sharing a basename and byte length.

Acceptance criteria

  • Dropping a non-image file such as a PDF from Finder onto a Terminal pastes a path to a byte-identical temp copy and does not open an editor tab.
  • Existing Finder/browser image drops continue to attach through the same path flow.
  • Shift-dragging files or folders from VS Code continues to paste their real absolute paths without copying them.
  • Multiple dropped files arrive in drag order as one bracketed paste and no input is submitted.
  • Files with an empty or unfamiliar MIME type are accepted and retain a safe recognizable extension when one is available.
  • An unusable URI in a mixed payload does not suppress accompanying byte-backed files.
  • Two distinct files with the same basename and size are both delivered.
  • Materialization is collision-safe and bounded; a failure is reported and produces no partial Terminal input.
  • The clipboard is unchanged.
  • Automated tests cover URI-backed, byte-backed, mixed, multi-file, collision, and failure behavior.
  • Packaged-build QA verifies at least a Finder image, Finder PDF, VS Code real-path drop, and a multi-file drop.
  • Domain documentation and the relevant ADRs record that the prior image-only byte fallback is intentionally superseded.

Blocked by

None - can start immediately

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions