Finish ad-hoc file open: drag-drop, recents, OS file associations #46

Merged
parkerhdavis merged 1 commit from adhoc-open-phase-2-3 into main 2026-06-01 16:25:49 -06:00
parkerhdavis commented 2026-06-01 16:25:43 -06:00 (Migrated from github.com)

Completes the ad-hoc file open roadmap item — Phases 2 and 3 on top of the Phase 1 picker / preview / edit that shipped earlier.

Phase 2 — drag-and-drop + recents

  • Drag-and-drop: drag a file from the OS file manager onto the window → a "Drop to open" overlay → on drop it opens ad-hoc (ephemeral preview, no catalog ingestion, same path as Ctrl+O). dragDropEnabled is now true so Tauri delivers native drop paths; FileDropZone prefers the first previewable path.
  • Recents: recentFilesStore (localStorage-persisted) records every ad-hoc open. Surfaced in the sidebar under "Open file…" (right-click → open folder / remove) and as a Recent files group in the Ctrl+K palette. openPathAdHoc is the shared sink every entry point funnels through.

Phase 3 — OS file associations ("Open with Garnet")

  • tauri-plugin-single-instance routes a second "Open with Garnet" into the running window instead of spawning a duplicate (must be the first registered plugin).
  • argv handling: a launch-with-a-file stashes the path (take_pending_open, drained by the frontend on mount); a second launch emits an open-file event the running app navigates on. Both land on the ephemeral preview.
  • bundle.fileAssociations registers Garnet as a handler for image / video / audio / 3D-model types (Linux .desktop MimeType, macOS document types, Windows registry).

Note: the OS-level association registration only lands on an installed bundle (make build) — you can't register a handler without installing. The plumbing that consumes it (single-instance + argv → open) is verified in dev: a second instance launched with a file argument exits cleanly and hands the path to the running window.

Verification

  • backend compiles with the new plugin; clippy clean; 130 tests pass
  • tsc + biome clean
  • boots cleanly via make dev; single-instance argv handoff confirmed end-to-end
Completes the **ad-hoc file open** roadmap item — Phases 2 and 3 on top of the Phase 1 picker / preview / edit that shipped earlier. ## Phase 2 — drag-and-drop + recents - **Drag-and-drop**: drag a file from the OS file manager onto the window → a "Drop to open" overlay → on drop it opens ad-hoc (ephemeral preview, no catalog ingestion, same path as Ctrl+O). `dragDropEnabled` is now `true` so Tauri delivers native drop paths; `FileDropZone` prefers the first previewable path. - **Recents**: `recentFilesStore` (localStorage-persisted) records every ad-hoc open. Surfaced in the sidebar under "Open file…" (right-click → open folder / remove) and as a **Recent files** group in the `Ctrl+K` palette. `openPathAdHoc` is the shared sink every entry point funnels through. ## Phase 3 — OS file associations ("Open with Garnet") - **`tauri-plugin-single-instance`** routes a second "Open with Garnet" into the running window instead of spawning a duplicate (must be the first registered plugin). - **argv handling**: a launch-with-a-file stashes the path (`take_pending_open`, drained by the frontend on mount); a second launch emits an `open-file` event the running app navigates on. Both land on the ephemeral preview. - **`bundle.fileAssociations`** registers Garnet as a handler for image / video / audio / 3D-model types (Linux `.desktop` MimeType, macOS document types, Windows registry). **Note:** the OS-level association registration only lands on an installed bundle (`make build`) — you can't register a handler without installing. The plumbing that consumes it (single-instance + argv → open) is verified in dev: a second instance launched with a file argument exits cleanly and hands the path to the running window. ## Verification - backend compiles with the new plugin; `clippy` clean; 130 tests pass - `tsc` + biome clean - boots cleanly via `make dev`; single-instance argv handoff confirmed end-to-end
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
parker/garnet!46
No description provided.