Repository navigation
feat(desktop): the dashboard opens in its installed app (ADR-0061) - #256
Merged
Merged
Conversation
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>
Merged
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.
Why
With the dashboard installed as a PWA (Chrome, Edge, Brave, Chromium), the tray's Open Dashboard,
devstack uiand a notification click still opened a browser tab: Chromium does not capture links into an installed app on Linux.What
--browser/DEVSTACK_BROWSER/BROWSERstill win.http://127.0.0.1:<port>/, first 16 bytes writtena–p. devstack computes that id, so it does not need to read the browser's data. An app installed fromlocalhostis not matched (it has a different origin and cookie).crates/devstack-desktop/src/webapp.rsplus one function per OS module):.desktoplaunchers in$XDG_DATA_HOME/applicationsand the desktop folder (XDG_DESKTOP_DIR, else~/Desktop) whoseExechas--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-, …).%LOCALAPPDATA%\<browser>\User Data\<profile>\Web Applications\Manifest Resources\<id>(Chrome, Edge, Brave, Chromium;Defaultfirst). The browser exe is looked up under%ProgramFiles%,%ProgramFiles(x86)%or%LOCALAPPDATA%.None).<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.ui/vite.config.ts):id: '/', which gives the same id as today, andlaunch_handler: { client_mode: 'navigate-existing' }so the open window is reused.devstack ui, the tray,devstack://openand the hub's own Linux notification click. That last one used to callopen_browserdirectly.devstack ui,devstack hub tray,DEVSTACK_BROWSER) and CHANGELOG [Unreleased] are updated. The HTTP API is unchanged, sodocs/dashboard-api.mdis untouched.Checked
imbjdaboabifmbceekoampobpbpodgfh). The double hash was confirmed against it.dashboard_appfinds the launcher on the desktop folder (~/Schreibtischviauser-dirs.dirs) and resolves the stale snap path to/snap/bin/brave..desktopparsing (quotes, field codes, other sections),user-dirs.dirs, the snap and PATH stand-ins, Windows profile discovery (tempdir).cargo clippy --all-targetsis clean for Linux (whole workspace),x86_64-pc-windows-msvcandaarch64-apple-darwin(devstack-desktop).cargo fmtis clean. Thedevstack-desktopanddevstack-hubtests pass. Theuibuild emitsidandlaunch_handlerinmanifest.webmanifest.Not checked
navigate-existingnow 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.launch_handlerto--app-launch-url-for-shortcuts-menu-itemlaunches.msedge.exerather thanmsedge_proxy.exe).🤖 Generated with Claude Code