Skip to content

Comments

Remove BrowserUtils.OpenDefaultBrowser and use ISessionManager#2261

Merged
mjcheetham merged 1 commit intogit-ecosystem:mainfrom
mjcheetham:browser-on-sessionmanager
Feb 5, 2026
Merged

Remove BrowserUtils.OpenDefaultBrowser and use ISessionManager#2261
mjcheetham merged 1 commit intogit-ecosystem:mainfrom
mjcheetham:browser-on-sessionmanager

Conversation

@mjcheetham
Copy link
Contributor

Given that the ISessionManager has the ability to determine if a web browser is available (via IsWebBrowserAvailable), it's only natural that this is the component that should also be responsible for actually launching the browser.

We remove the BrowserUtils class and transpose its only method (OpenDefaultBrowser) to the session manager component. This means we can keep the Linux-specific behaviour in a scoped component.

@mjcheetham mjcheetham requested review from a team as code owners February 4, 2026 16:38
@mjcheetham mjcheetham added the engineering Refactoring or build changes label Feb 4, 2026
Given that the ISessionManager has the ability to determine if a web
browser is available (via `IsWebBrowserAvailable`), it's only natural
that this is the component that should also be responsible for
actually launching the browser.

We remove the `BrowserUtils` class and transpose its only method
(`OpenDefaultBrowser`) to the session manager component. This means we
can keep the Linux-specific behaviour in a scoped component.

Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
Copy link
Contributor

@dscho dscho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, this requires a lot of changes! But the intention makes sense to me, and I see that there is no way to make this change more minimal.

@mjcheetham
Copy link
Contributor Author

Wow, this requires a lot of changes! But the intention makes sense to me, and I see that there is no way to make this change more minimal.

Yeah, the BrowserUtils.OpenDefaultBrowser(IEnvironment, Uri) method was used in many places, and much of this PR diff is just updating the call-sites to use ISessionManager.OpenBrowser(Uri) instead.

We could update the call-sites piece meal, but each commit would leave things uncompilable? Thoughts?

@dscho
Copy link
Contributor

dscho commented Feb 5, 2026

Wow, this requires a lot of changes! But the intention makes sense to me, and I see that there is no way to make this change more minimal.

Yeah, the BrowserUtils.OpenDefaultBrowser(IEnvironment, Uri) method was used in many places, and much of this PR diff is just updating the call-sites to use ISessionManager.OpenBrowser(Uri) instead.

We could update the call-sites piece meal, but each commit would leave things uncompilable? Thoughts?

No, I'd prefer it to be compilable. Those changes that update the call sites are somewhat repetitive, but easy to verify, and the fact that the result compiles cleanly proves that no call site was missed. So it's all good to go from my side.

@mjcheetham mjcheetham merged commit 2727c9c into git-ecosystem:main Feb 5, 2026
10 checks passed
@mjcheetham mjcheetham deleted the browser-on-sessionmanager branch February 5, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engineering Refactoring or build changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants