Add explorer copy path, native file actions, and Lapis app URLs #90
Labels
No labels
abandoned
active
audit
blocked
data-safety
difficulty:easy
difficulty:hard
difficulty:high
difficulty:medium
docs
done
duplicate
notebook-v0
open
priority:high
ready
release-critical
safe-mode
spec
spec-backlog
subsystem:api
subsystem:backlog
subsystem:bases
subsystem:ci
subsystem:command
subsystem:configuration
subsystem:consolidate
subsystem:dependencies
subsystem:desktop-electron
subsystem:diffmerge
subsystem:docker
subsystem:docs
subsystem:fuzzy
subsystem:graph
subsystem:hotkeys
subsystem:lapis
subsystem:maint
subsystem:maintenance
subsystem:markdown
subsystem:markdown-lint
subsystem:md018
subsystem:notebook
subsystem:notifications
subsystem:opfs
subsystem:package
subsystem:plugin-markdown
subsystem:plugin-tasks
subsystem:plugins
subsystem:registry
subsystem:release
subsystem:renovate
subsystem:restore
subsystem:scripts
subsystem:search
subsystem:settings
subsystem:spec
subsystem:tasks
subsystem:testing
subsystem:ui
subsystem:web
subsystem:workspace
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lapis-notes/lapis#90
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add daily-use file location actions to the file explorer and add a Lapis app URL
contract for opening vault files from copied links or external app launches.
Problem
The file explorer does not expose common file-location actions that users expect
in a local-first notes app: copying vault-relative paths, copying host paths,
copying durable app URLs, opening files in the OS default app, or revealing files
in the host file manager.
Lapis also does not yet have an app URL contract comparable to Obsidian URI
links. Without that, users cannot copy a stable
lapis://open?...URL from theexplorer or open a file from outside the app with a link such as:
Goal
Make explorer file actions and Lapis app URLs work across the supported
daily-use hosts, with Electron receiving full native file actions and browser/PWA
using only actions the web platform can support safely.
Scope
Copy Pathsubmenu to explorer item context menus.default-app open, and file-manager reveal.
lapis://customscheme and preserve the existing
lapis-notes://alias if needed.Non-goals
obsidian://.new,daily,unique,search,choose-vault, or Hook integration in this slice.needed for existing Obsidian-style plugin APIs.
Acceptance Criteria
Copy Pathwith:From vault folderFrom system rootwhen the host can provide a system pathAs Lapis URLfor files onlyseparators:
Open in default appReveal in Finderon macOS,Reveal in File Exploreron Windows, orReveal in file managerelsewherehost advertises support for them.
failure through the normal notice path.
As Lapis URLproduces encodedlapis://open?vault=...&file=...links forfiles.
lapis://open?vault=<vault>&file=<path>withencoded paths and lenient existing links that contain spaces or slashes.
openparameters where practical:vaultcan match the current vault name or idfilecan be a vault-relative path or markdown path without.mdpathoverridesvaultandfileon desktop/native sessionspaneType=tab|split|windowmaps to supported Lapis workspace behavior, withwindowdesktop-only or gracefully unsupportedfileremain part of the open request for laternavigation handling instead of being discarded
lapis://vault/<vault>/<file>lapis:///absolute/pathlapis://links on cold start, secondinstance launches, and macOS
open-url, queueing links until the renderer isready.
Plugin.registerObsidianProtocolHandler()registers and cleans up handlersagainst the shared URL service so Lapis/plugin actions can reuse the same
decoded parameter shape.
supported Electron launch paths.
routing, PWA limitations, and Electron protocol registration.
Implementation Notes
Define shared path and URL helpers.
Add a small API/workspace helper for explorer targets:
file.path, no leading slashpath
lapis://open?vault=<encoded vault id or name>&file=<encoded vault-relative path>Generated URLs should be strictly encoded even though the parser should
accept lenient inputs such as unencoded spaces and
/in copied examples.Update the file explorer context menu.
In
packages/workspace/src/lib/feature/file-explorer/file-explorer.svelte,add:
Copy PathsubmenuFrom vault folderFrom system rootAs Lapis URLonly forTFileAdd desktop actions between separators:
Open in default appBrowser File System Access does not expose stable absolute system paths or OS
reveal/default-app hooks, so those actions should stay hidden or disabled
unless a future web host capability explicitly advertises support.
Extend the native desktop bridge.
Add host-neutral bridge commands/capabilities for:
Electron should implement these in
packages/desktop-electron/src-electron/main.tsusing Electronshell.openPath()andshell.showItemInFolder().Add Lapis app URL parsing and dispatch.
Add an API-owned URL service, such as
AppUrlService, that can parse anddispatch:
lapis://open?vault=<vault>&file=<path>lapis://open?path=<absolute path>lapis://vault/<vault>/<file>shorthandlapis:///absolute/pathshorthandpaneType=tab|split|windowMatch Obsidian's important
opensemantics:pathoverridesvaultandfile;filecan be a filename or vault-relative path;.mdcan be omittedfor markdown; heading/block suffixes should remain part of the file
navigation target.
Register desktop custom protocols.
Electron currently packages
lapis-notes://. Addlapis://as the primaryscheme and keep
lapis-notes://as an alias if needed.Handle URLs from:
open-urlQueue inbound URLs until the workspace is mounted, then dispatch through the
shared URL service.
Add PWA URL handling.
Add web manifest protocol-handler support only where browsers allow it. The
practical web target is:
web+lapis://open?...for installed PWAs where supported/open?url=<encoded lapis url>Bare
lapis://should be treated as native desktop-first.Support Obsidian-style custom action handlers.
Plugin.registerObsidianProtocolHandler()is currently effectively a no-op.Implement it against the new URL service so plugins can register custom
actions, preserving the Obsidian-compatible decoded param shape where
obsidian://action?key=valuemaps to params includingaction.For Lapis, dispatch
lapis://<action>?...to the same registry.Update tests and docs.
Add focused tests for:
vault/file,path, shorthand forms, encoded paths, andlenient unencoded spaces/slashes
Suggested Files or Specs To Inspect
packages/workspace/src/lib/feature/file-explorer/file-explorer.sveltepackages/workspace/src/lib/feature/file-explorer/index.tspackages/api/src/lib/context.svelte.tspackages/api/src/lib/plugin.tspackages/api/src/lib/storage/desktop-native.tspackages/api/src/lib/storage/vault-state.tspackages/desktop-electron/src-electron/main.tspackages/desktop-electron/src-electron/preload.tspackages/desktop-electron/electron-builder.config.cjspackages/web/vite.config.tsspec/src/20-packages/workspace/index.mdspec/src/20-packages/desktop-electron/index.mdspec/src/20-packages/web/index.mdspec/src/30-cross-package-contracts/storage-metadata-search.mdspec/src/30-cross-package-contracts/plugin-runtime.mdValidation Commands
Follow-up Tasks
new,search, orchoose-vaultonly afterthe
openpath is stable.preserves but does not yet navigate subpaths.
lapis://support if browser protocol-handler restrictionschange.
Implementation Summary
Implemented explorer Copy Path submenu actions, native Electron file open/reveal/path resolution IPC, Lapis app URL parsing and dispatch, desktop lapis:// and lapis-notes:// launch handling, PWA web+lapis routing, and Obsidian-style plugin protocol handler registration through the app URL service.