Repository navigation
feat(platform): add desktop Tx::open_path and Tx::reveal_path with headless Runtime::take_path_requests - #1947
Merged
Merged
Conversation
Hona
force-pushed
the
feat/147-open-path
branch
from
November 24, 2026 14:43
37cd875 to
f3e3846
Compare
…adless Runtime::take_path_requests
Hona
force-pushed
the
feat/147-open-path
branch
from
November 24, 2026 14:57
f3e3846 to
217e28f
Compare
This was referenced Nov 24, 2026
Hona
added a commit
that referenced
this pull request
Nov 25, 2026
…une and procwatch (#2370) A feature-set warning sweep across Linux, macOS, Windows, and wasm32 found eight dead-code warnings under optional and non-default feature sets: - `crates/rune/src/open_path.rs:203` (`file_uri_from_bytes`, added in #1947): used on Unix only under `feature = "dbus"` (FileManager1) and tests; gate with `feature = "dbus"` alongside `test`. - `crates/rune/src/platform/preferences.rs:77` (`DEFAULT_DOUBLE_CLICK_SECS`, added in #1923/#2128): used on Linux only under `feature = "dbus"` and tests; gate with `all(target_os = "linux", feature = "dbus")` alongside `test`. - `crates/rune/src/window/titlebar/linux.rs:82` (`Sides::ALL`, added in #2244): used only in `linux_tests.rs`; gate with `#[cfg(test)]`. - `crates/rune/src/frame/live_log.rs:33` (`CAPTURED` / `capture_frames`, added in #2309): used only in `window/win32/resize_sync/tests.rs` under `frame-profile`; gate with `#[cfg(all(test, target_os = "windows"))]`. - `crates/procwatch/src/alloc/sites.rs:222,271,413,418` (`report`, `unsampled`, `os::modules`, `os::nt_heaps`, added in #744): `alloc-sites` sampling and dumper are Windows-only; gate the implementation behind `#[cfg(windows)]` with clean `#[cfg(not(windows))]` no-op stubs.
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.
Fixes #147
Adds desktop
Tx::open_pathandTx::reveal_pathalongside headlessRuntime::take_path_requests, keepingTx::open_urlstrictly limited tohttp:,https:, andmailto:links.API
OpenPathError::{Empty, Invalid, Unsupported, Failed(String)},PathAction::{Open, Reveal}, andPathRequest { path: PathBuf, action: PathAction }re-exported fromrune.Tx::open_path(impl AsRef<Path>)andTx::reveal_path(impl AsRef<Path>)validate syntax only (Empty, embedded NUL ->Invalid, non-desktop targets ->Unsupported), obeying Rune's no-file-I/O-in-frame-loop rule.Runtime::take_path_requests()drains captured requests; headless CLI runs log unexecutedopen_path/reveal_pathrequests besideopen_url.examples/drop-filesshows accessible Open and Reveal buttons for dropped file paths (plus a--scene droppedscene).Frame & Platform Flow
flowchart LR H["Handler: tx.open_path / tx.reveal_path"] --> V{"Syntax check (no I/O)"} V -->|Empty / NUL / non-desktop| E["Err(OpenPathError)"] V -->|Ok| Q["Tx.open_paths"] Q -->|End of frame| D{"open_urls_natively?"} D -->|false: headless / tests| R["Runtime::take_path_requests()"] D -->|true: desktop| W["Background worker (off UI thread)"] W --> M["macOS: stat on worker -> mainQueue NSWorkspace"] W --> Win["Windows: STA worker ShellExecuteW / SHOpenFolderAndSelectItems"] W --> L["Linux: portal worker OpenURI.OpenFile / FileManager1.ShowItems -> OpenURI.OpenDirectory -> xdg-open"]Outside Answers Followed
shell.openPath/shell.showItemInFolder) and Rune'sTx::open_url(crates/rune/src/open_url.rs): separate desktop path APIs from web/mail URLs, queued onTxand drained after the frame, captured in headless runs.platform_util_mac.mm:NSWorkspaceopenURL:configuration:completionHandler:(fallbackopenURL:) andactivateFileViewerSelectingURLs:on the main queue withNSURL::fileURLWithPath_isDirectory:after background path resolution/metadata check so the UI thread never stats and AppKit never runs off the main thread.ShellExecuteW(default verb) for open andILCreateFromPathW+SHOpenFolderAndSelectItems(pidl, None, 0)+ILFreefor reveal, normalizing slashes and\\?\verbatim prefixes.org.freedesktop.portal.OpenURI.OpenFileopens both files and directories; reveal triesorg.freedesktop.FileManager1.ShowItems(RFC 8089file://URI), thenorg.freedesktop.portal.OpenURI.OpenDirectory, thenxdg-openon the parent folder.Not Checked Live
xdg-open) and live interactive windows were not launched on a desktop; native dispatch is covered through a unit-tested seam (HostState::dispatch_paths) and platform-specific compilation/unit tests.