Skip to content

feat(hub): open a stack's folder in the user's programs (ADR-0046) - #173

Merged
7schmiede merged 3 commits into
mainfrom
feat/open-path
Oct 21, 2026
Merged

7schmiede merged 3 commits into
mainfrom
feat/open-path

Conversation

@7schmiede

@7schmiede 7schmiede commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

What

The path in the stack header (D:\src\app) becomes a menu, like the worktree picker beside it:

  • Copy path: always offered; the only entry for a lane shared with you (it lives on another machine).
  • Open in: Explorer / file manager, Windows Terminal, PowerShell (Windows), Terminal (Linux), VS Code, VS Code Insiders, Cursor, Windsurf, Zed, Claude Desktop, Claude Code, Orca. Only the programs the hub finds on this machine are listed.

How the hub finds the programs

  • Editors and agents: by the URL scheme they registered.
    • Windows: HKCR\<scheme> with a URL Protocol value. Packaged apps such as Claude Desktop are covered too.
    • Linux: xdg-mime query default x-scheme-handler/<scheme>.
    • The hub opens them with a link of that scheme, through the shell (ShellExecuteW / xdg-open):
      • vscode://file/<path> (also Cursor, Windsurf, Zed)
      • claude://code/new?folder=
      • claude-cli://open?cwd=
  • Terminals: by their program.
    • Windows Terminal: wt.exe on PATH, started as wt -d.
    • PowerShell: pwsh before powershell, in a new console.
    • Linux: $TERMINAL, x-terminal-emulator, then common terminals.
  • Orca: has no scheme. The hub uses its CLI: orca open, then orca file open <stack file> --worktree path:<tree> --focus. If Orca does not know the repository yet, the hub runs orca repo add first.

Security (ADR-0046 point 3)

POST /hub/open {stack, path, with}:

  • path must be the stack's repository or one of its worktrees (git worktree list, new lanes::worktree_of).
  • with must be an id from the list the hub has just found.
  • The page never sends a program or a command line.
  • The request needs the cookie and the hub's own Origin, like every mutation.

Status

ADR-0046 is Accepted (2026-10-21).

Checked

  • cargo clippy --workspace --all-targets -D warnings on Windows; hub and daemon also on Linux, in Docker.
  • Hub and daemon tests pass, including new tests for link encoding and for worktree_of.
  • UI: typecheck and vitest pass, including a new store test.
  • On Windows 11, detection finds exactly the programs installed here: Explorer, Windows Terminal, PowerShell, VS Code, Claude Desktop, Claude Code, Orca.
  • Explorer opened through ShellExecuteW.
  • Not yet tried by clicking in the real dashboard:
    • each program other than Explorer;
    • whether a window opens behind the browser, since the hub runs in the background.

🤖 Generated with Claude Code

7schmiede and others added 3 commits October 21, 2026 14:39
The path in the stack header is a menu: copy it, or open the shown tree
(main working tree or a lane's worktree) in Explorer / the file manager,
Windows Terminal, PowerShell or a Linux terminal, VS Code (Insiders),
Cursor, Windsurf, Zed, Claude Desktop, Claude Code or Orca.

The hub finds them itself: editors and agents by the URL scheme they
registered (HKCR\<scheme> with `URL Protocol`, `xdg-mime` on Linux),
started by a link of that scheme through the shell; terminals and Orca
by their program. `POST /hub/open` takes a stack, a path that must be
the stack's repository or one of its worktrees, and an id from the list
just found: never a program or a command line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@7schmiede
7schmiede merged commit 34ed22e into main Oct 21, 2026
@7schmiede 7schmiede mentioned this pull request Oct 21, 2026
@7schmiede
7schmiede deleted the feat/open-path branch October 23, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant