Skip to content

Honour the browser setting on every screen, and say which way it is set - #1029

Draft
aayy-dev wants to merge 1 commit into
JingMatrix:masterfrom
aayy-dev:open-links-setting
Draft

aayy-dev wants to merge 1 commit into
JingMatrix:masterfrom
aayy-dev:open-links-setting

Conversation

@aayy-dev

Copy link
Copy Markdown

"Open links in a browser" was asked by Home alone. HomeScreen kept a private open() that checked it, but every other screen's onOpenUrl was wired in VectorApp straight to navigator.go(Web(url)), so module pages in the store, the canary list, the troubleshooter and the framework update screen opened the in-app viewer whichever way the switch was set. The setting is now asked in one place, openLink in VectorApp, which every screen is handed as its onOpenUrl; Home's copy and the HomeViewModel flow that fed it are gone.

With the store's links in play, the browser path now sees URLs from the module catalogue (homepageUrl, sourceUrl, url) rather than only ones the app built itself, so the fallback to the viewer catches any exception from startActivity, not just ActivityNotFoundException: a file:// homepage would otherwise throw FileUriExposedException and take the manager down. WebScreen already uses runCatching for its own hand-off.

The row's subtitle also read "Off: GitHub pages open inside Vector." with the switch on. It now has an On line, settings_open_externally_summary_on, added to all 18 locales next to the Off one so check_translations.py stays clean. Those translations were written to mirror each locale's existing Off line and its own word for "browser"; corrections through Crowdin are welcome.

Tested on a Pixel Fold (Android 16) with a locally built zipRelease flashed through Magisk: with the switch on, Home's commit links and a store module's repository button open in the default browser; with it off, both open in the in-app viewer; the subtitle follows the switch.

"Open links in a browser" was asked by Home alone. HomeScreen kept a
private open() that checked it, but every other screen's onOpenUrl was
wired in VectorApp straight to the in-app viewer, so module pages in the
store, the canary list, the troubleshooter and the framework update
screen opened the viewer whichever way the switch was set. The setting
is now asked in one place, openLink in VectorApp, which every screen is
handed as its onOpenUrl; Home's copy is gone.

With the store's links in play, the browser path now sees URLs from the
module catalogue rather than only ones the app built itself, so the
fallback to the viewer catches any exception from startActivity, not
just ActivityNotFoundException: a file:// homepage would otherwise throw
FileUriExposedException and take the manager down.

The row's subtitle also read "Off: GitHub pages open inside Vector."
with the switch on. It now has an On line, added to every locale
alongside the Off one.
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