Open links in a webapp window instead of a browser tab - #7
Conversation
|
Thanks for this — works as described on my system. Rather than swapping unconditionally, would you consider making it configurable? A few thoughts:
Happy to push commits to that effect here if useful, or happy to review whatever shape you land on. |
|
Thanks again for testing and for pushing on configurability — it's in much better shape now. Open links is a proper setting with three options: Browser tab (default, unchanged), Web app window, and Web app window (reuse) (7977b20 + b2c51d1). Your point 2 took a detour though: I implemented it with Default stays Browser tab per your compatibility point, so existing users see zero change, and the two webapp options flag the Hyprland/Chromium requirements in their descriptions. Would you mind taking another look? |
There was a problem hiding this comment.
Thanks for iterating so quickly — the three-mode setting reads well and the Quattro dispatch handling (hl.dsp.window.close(...) with the legacy fallback) is correct on my system.
One substantive problem in omarchy-github-open:
The window-class pattern only matches Google Chrome. The script uses:
pattern='chrome-github\.com__'Chromium-based browsers derive the app-window class from their own binary name, so the same URL produces different classes per browser:
- Google Chrome:
chrome-github.com__-Default - Brave:
brave-github.com__-Default - Chromium:
chromium-github.com__-Default - etc.
I confirmed on my system (Brave is the default browser): running web app windows appear as brave-web.whatsapp.com__-Default, brave-x.com__-Default, etc. So with any non-Chrome default browser, "Web app window (reuse)" never finds the existing GitHub window, skips the close step entirely, and piles up a fresh window per click — which is exactly the behavior this mode exists to prevent. Given Omarchy defaults to Chromium, this will bite a lot of users, so I think it needs fixing before merge.
Suggested fix — match on the origin rather than the browser prefix:
pattern='github\.com__'or, slightly tighter:
pattern='[a-z-]+-github\.com__'Minor nit: Qt.resolvedUrl("omarchy-github-open")...replace(/^file:\/\//, "") breaks if the resolved path ever gets percent-encoded (spaces/unicode in $HOME); decodeURIComponent() on the stripped result would make it robust. Not blocking.
|
Both fixed in 6c5670a — thanks for catching the class issue, and you were right that it would have bitten a lot of users. Amusingly it worked on my setup by pure luck: I went with your first suggestion ( Also applied your Ready for re-review whenever you get a chance! |
|
Thanks for this. I've combined it with #9 and merged it in #10 — your first commit is the behaviour I've settled on, and it's in What landed:
I merged rather than squashed specifically so those stayed yours. What I dropped, both to keep the surface small:
Closing as merged via #10. |
Summary
All panel links funnel through
openUrl()inPanel.qml, which launchedomarchy-launch-browser. This switches it to Omarchy'somarchy-launch-webapp, so notifications, review requests, pull requests, assigned issues, workflow runs, and repositories open in a dedicated app-mode window (chromium --app=<url>) instead of a new browser tab.Notes
omarchy-launch-webappships with Omarchy and targets Chromium-based default browsers (falling back to chromium.desktop). On systems whose default browser is not Chromium-based, behavior would differ — happy to gate this behind a bar-widget setting if you would rather keep browser-tab behavior for those setups.omarchy plugin validate .and all bundled tests (helper-test.sh,panel-source-test.sh,service-source-test.sh).