Skip to content

feat(desktop): the dashboard opens in its installed app (ADR-0061) - #256

Merged
7schmiede merged 1 commit into
mainfrom
claude/optimistic-jang-04ee9f
Oct 23, 2026
Merged

7schmiede merged 1 commit into
mainfrom
claude/optimistic-jang-04ee9f

Conversation

@7schmiede

Copy link
Copy Markdown
Member

Why

With the dashboard installed as a PWA (Chrome, Edge, Brave, Chromium), the tray's Open Dashboard, devstack ui and a notification click still opened a browser tab: Chromium does not capture links into an installed app on Linux.

What

  • ADR-0061, status Proposed. devstack opens the dashboard in its installed app when it finds one, else the browser as before; --browser / DEVSTACK_BROWSER / BROWSER still win.
  • Matching by app id, not by name. Chromium names an installed web app by its manifest id: SHA-256 of SHA-256 of http://127.0.0.1:<port>/, first 16 bytes written a–p. devstack computes that id, so it does not need to read the browser's data. An app installed from localhost is not matched (it has a different origin and cookie).
  • Finding the app (crates/devstack-desktop/src/webapp.rs plus one function per OS module):
    • Linux: .desktop launchers in $XDG_DATA_HOME/applications and the desktop folder (XDG_DESKTOP_DIR, else ~/Desktop) whose Exec has --app-id=<id>. A /snap/<name>/<rev>/… program runs as /snap/bin/<name>, because the revision in the launcher goes stale. A missing program is looked up on PATH by the launcher's file prefix (brave-, chrome-, …).
    • Windows: %LOCALAPPDATA%\<browser>\User Data\<profile>\Web Applications\Manifest Resources\<id> (Chrome, Edge, Brave, Chromium; Default first). The browser exe is looked up under %ProgramFiles%, %ProgramFiles(x86)% or %LOCALAPPDATA%.
    • macOS: not yet (returns None).
  • Launch: <browser> --profile-directory=<p> --app-id=<id> --app-launch-url-for-shortcuts-menu-item=<pairing link>. The program is spawned directly, with no shell. The PWA shares the profile's cookie, so pairing works as before. If the launch fails, the browser opens instead.
  • Manifest (ui/vite.config.ts): id: '/', which gives the same id as today, and launch_handler: { client_mode: 'navigate-existing' } so the open window is reused.
  • The same path now serves devstack ui, the tray, devstack://open and the hub's own Linux notification click. That last one used to call open_browser directly.
  • README (devstack ui, devstack hub tray, DEVSTACK_BROWSER) and CHANGELOG [Unreleased] are updated. The HTTP API is unchanged, so docs/dashboard-api.md is untouched.

Checked

  • Linux (Ubuntu GNOME, snap Brave), on this machine: the computed id matches the installed devstack PWA (imbjdaboabifmbceekoampobpbpodgfh). The double hash was confirmed against it. dashboard_app finds the launcher on the desktop folder (~/Schreibtisch via user-dirs.dirs) and resolves the stale snap path to /snap/bin/brave.
  • Unit tests: app id, origin parsing, .desktop parsing (quotes, field codes, other sections), user-dirs.dirs, the snap and PATH stand-ins, Windows profile discovery (tempdir).
  • cargo clippy --all-targets is clean for Linux (whole workspace), x86_64-pc-windows-msvc and aarch64-apple-darwin (devstack-desktop). cargo fmt is clean. The devstack-desktop and devstack-hub tests pass. The ui build emits id and launch_handler in manifest.webmanifest.

Not checked

  • An actual click from the tray with this build. The launch command was verified by hand earlier: it opened the PWA, but as a second window. Whether navigate-existing now reuses the window is untested. It needs the new hub serving the new manifest, and Brave has to pick up the updated manifest, which can take a reload or a reinstall of the app.
  • Whether Chromium applies launch_handler to --app-launch-url-for-shortcuts-menu-item launches.
  • Windows: compiled only. The profile-folder detection, the exe paths and the launch are not run on Windows. Neither is Edge (msedge.exe rather than msedge_proxy.exe).
  • macOS: nothing changes there.

🤖 Generated with Claude Code

A Chromium-family browser does not capture links into an installed web
app on Linux, so the tray's Open Dashboard, `devstack ui` and a click on a
notification opened a browser tab beside the installed dashboard app.

devstack now computes the app id Chromium gives the hub's dashboard (the
double SHA-256 of its manifest id `http://127.0.0.1:<port>/`), finds the
app (Linux: the launcher's `.desktop` file in the applications and the
desktop folder; Windows: the browser profile that has it; not on macOS
yet) and starts the browser with `--app-id` and the pairing link. The
manifest names its `id` and asks for the open window to be reused
(`launch_handler: navigate-existing`). `--browser`, `DEVSTACK_BROWSER` and
`BROWSER` still win; a failed launch falls back to the browser.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@7schmiede
7schmiede merged commit fcda52a into main Oct 23, 2026
13 checks passed
@7schmiede
7schmiede deleted the claude/optimistic-jang-04ee9f branch October 23, 2026 21:36
@7schmiede 7schmiede mentioned this pull request Oct 23, 2026
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