Repository navigation
feat: accept smb:// URLs with mount-on-demand — true one-click on macOS - #1
Merged
Merged
Conversation
POST /open now takes smb://server/share/... URLs in addition to local paths, so one payload works on every OS even when the share isn't mounted yet: - macOS mounts on demand via the NetFS framework — the same path Finder uses (mounts under /Volumes, Keychain credentials) but with no Finder window at the share root. Mounts run silently first (kNAUIOptionNoUI) so a failed mount returns a clean JSON error instead of the system "There was a problem connecting to the server" alert; the standard auth dialog is only allowed when the failure is missing credentials. Already-mounted shares are matched in the mount table (getfsstat), including percent-encoded mntfromname entries. - Windows translates to the equivalent UNC path, which resolves natively. - Linux mounts through gvfs (gio mount) and opens the path inside the user's gvfs FUSE mount. Live-tested against a real SMB share from a fully unmounted state: silent mount + exactly one Finder window at the target folder; missing subfolders still 404, bad share names return JSON 500 with no dialogs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Implements the server-side v0.2 called out in StirlingMarketingGroup/StirlingMarketingGroup#7020 (comment): on macOS, opening a folder on a share that isn't mounted yet previously returned
not_found; true one-click needed mount-on-demand.What changed
POST /opennow acceptssmb://server/share/...URLs in addition to absolute local paths, so one payload works on every OS:smb_darwin.go): checks the mount table (getfsstat) for an existing smbfs mount of the host+share (handles percent-encodedmntfromnamelike//brian@storage/Signature%20Coins); if absent, mounts via the NetFS framework (NetFSMountURLSyncthrough cgo) — the same mechanism Finder uses: mounts under/Volumes, Keychain credentials, and no Finder window at the share root (the explicit reasonopen smb://was ruled out).kNAUIOptionNoUI): a failed mount returns a clean JSON error for the caller's ShowError instead of popping the system "There was a problem connecting to the server" alert. Only credential failures (EAUTH/ENEEDAUTH/EACCES/EPERM) retry with UI allowed, so the standard auth dialog still appears for first-time users and saves to the Keychain.smb_windows.go): translates to the equivalent UNC path (\\server\share\...), which Windows resolves and authenticates natively.smb_linux.go): mounts through gvfs (gio mount) and opens the path inside the user's gvfs FUSE mount, matching the share directory case-insensitively.Percent-encoding is optional (literal spaces accepted). Missing folders below the share are still a real
404/not_found; a share that can't be mounted is a500with the mount error. No client code changes needed — only a TSDoc note onopen().Live test (real
storageshare, macOS)From a fully unmounted state:
smb://storage/Signature Coins/<order folder>→ silent Keychain mount + exactly one Finder window at the target folder (Unicode/RTL folder names included)404not_foundsmb://storage/NoSuchShareXYZ→500JSON, no system alert, no windows400bad_requestVerify
go build ./... && go vet ./... && go test ./...GOOS=windows go build/GOOS=linux CGO_ENABLED=0 go buildcd packages/client && npm ci && npm run buildNew tests cover URL parsing and the mount-table source parser only — per AGENTS.md they never mount a share or open a window.
🤖 Generated with Claude Code