Repository navigation
feat(gui): register .wind desktop file association (#148) - #321
Merged
Merged
Conversation
Double-clicking a `.wind` file now opens it in FiberPath. Declare the association via `bundle.fileAssociations` so the Tauri bundler writes the per-platform metadata (registry on Windows, `.desktop`/MIME on Linux, `CFBundleDocumentTypes` on macOS). The launch path is received differently per platform and unified into one delivery: Windows/Linux pass it as a command-line argument (read from `std::env::args` on cold start, forwarded by the single-instance plugin on a second launch); macOS delivers it as an Apple Event via `RunEvent::Opened`. A `frontend_ready` flag routes each open through exactly one channel — stashed for the frontend to drain on a cold start, emitted as `open-wind-file` once it is listening — so a file is never loaded twice or dropped. The single-instance guard also focuses the existing window instead of spawning a duplicate. The frontend reuses the existing dirty-checked `openRecent` load path and lands in the Prepare workspace. Argument parsing is isolated in `file_association.rs` with unit tests; OS-level registration only takes effect in a packaged build (AppImage is best-effort), so the double-click matrix is left to manual QA.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #148.
Double-clicking a
.windfile now opens it in FiberPath.Approach
bundle.fileAssociationsintauri.conf.jsonregisters the.windextension (media typeapplication/vnd.fiberpath.wind+json, roleEditor). The Tauri bundler turns this into the per-platform metadata: registry entries (Windows nsis/msi), a.desktopMimeType+ MIME XML (Linux deb/appimage), andCFBundleDocumentTypes(macOS app/dmg).std::env::args; a second launch is forwarded bytauri-plugin-single-instance(registered first), which also focuses the existing window instead of spawning a duplicate.RunEvent::Opened { urls }.frontend_readyflag in managed state means a path is stashed until the frontend drains it on mount (take_opened_file) and emitted (open-wind-file) thereafter. The frontend subscribes before draining, so an open is never loaded twice or dropped.openRecentflow (JSON parse + schema validation already there) and land in the Prepare workspace. The arg-parsing logic lives infile_association.rswith unit tests.Tests / checks
cargo test(7 pass, incl. 5 newwind_path_from_argscases) ·clippy -D warningsclean ·cargo fmt --checkcleanvitest324 pass (2 new App-shell tests: open-on-launch + no-op when nothing handed over) ·tsc+svelte-checkclean · stylelint + CSS-var guard clean · bundle budget passedRunEvent::Openedarm iscfg-gated (doesn't compile on the Linux CI host); verified by inspection against the installedtauri 2.11.3/url 2.5/tauri-plugin-single-instance 2.4sources (RunEvent::Opened { urls: Vec<url::Url> },Url::to_file_path() -> Result<PathBuf, ()>, callbackFnMut(&AppHandle, Vec<String>, String)).Not covered here (manual QA)
OS-level registration only exists after installing a packaged build, so install-and-double-click can't run in CI. The per-platform double-click matrix belongs on the manual validation checklist (#149). AppImage association is best-effort — a portable AppImage isn't system-registered unless integrated; the
.debregisters normally.Behaviour change
The single-instance guard means a second launch now focuses the running window rather than opening a second instance — the correct UX for a single-document desktop app, and what makes warm-open work on Windows/Linux.