Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NO MERGE: Open browser tab from command #6601

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mitchdenny
Copy link
Member

@mitchdenny mitchdenny commented Nov 4, 2024

Description

This is just a spike on opening a browser tab in response to command defined in the app model executing. The biggest issue with this so far is that opening the tab is blocked by the popup blocker (for good reason).

To solve this problem, I think we are going to want to define a kind of ResourceUrlCommandAnnotation or something like that which results in the tab being opened in response to the user initiated click in a browser.

Another issue this PR has which is specific to codespaces it that the URL we insert isn't Codespace forwarding URL aware. So we'll need to be able to inject the URL command annotations after endpoints have been allocated.

Fixes # (issue)

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?
Microsoft Reviewers: Open in CodeFlow

@mitchdenny mitchdenny marked this pull request as draft November 4, 2024 11:11
@mitchdenny mitchdenny added NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) area-dashboard area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication labels Nov 4, 2024
@JamesNK
Copy link
Member

JamesNK commented Nov 6, 2024

We could choose violence and just call Process.Start("http://theurl.com"); in the command. That launches a new browser with the URL.

(I think doing it in the browser is probably better, even if it requires showing a dialog with the link)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication area-dashboard NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants