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

feat: open webview from image action #235

Merged
merged 4 commits into from
Mar 28, 2024

Conversation

deboer-tim
Copy link
Contributor

What does this PR do?

Removes the quick pick command, and instead triggers opening the webview, switching to
the build page, and preselecting the image.

Screenshot / video of UI

N/A

What issues does this PR fix or reference?

How to test this PR?

Tests still to-do.

@slemeur
Copy link
Contributor

slemeur commented Mar 26, 2024

Is this needed?

@deboer-tim
Copy link
Contributor Author

This is removing the quick pick and making all the paths go to the webview - isn't that the intention?

Removes the quick pick command, and instead triggers opening the webview, switching to
the build page, and preselecting the image.

Signed-off-by: Tim deBoer <[email protected]>
Adding tests for the command redirecting to the build page, and for the build
page allowing an initial selection.

To test a select control the values must be strings, so I had to rework the
Build page a bit to use string values.

Signed-off-by: Tim deBoer <[email protected]>
@deboer-tim
Copy link
Contributor Author

Added tests, and rebased on main. Ready for full review.

@deboer-tim deboer-tim marked this pull request as ready for review March 28, 2024 16:25
@deboer-tim deboer-tim requested a review from a team as a code owner March 28, 2024 16:25
packages/backend/src/extension.ts Outdated Show resolved Hide resolved

// if we trigger immediately, the webview hasn't loaded yet and can't redirect
// if we trigger too slow, there's a visible flash as the homepage appears first
await new Promise(r => setTimeout(r, 100));
Copy link
Contributor

Choose a reason for hiding this comment

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

Unfortunate that we're unable to figure out if the extension has loaded yet before switching to the web view.

Has there been a solution for this within ai studio or podman desktop / they've encountered the same thing when redirecting after loading the web view?

@feloy @axel7083 @lstocchi

packages/backend/src/extension.ts Outdated Show resolved Hide resolved
packages/frontend/src/App.svelte Outdated Show resolved Hide resolved
packages/frontend/src/Build.svelte Outdated Show resolved Hide resolved
packages/frontend/src/Build.svelte Outdated Show resolved Hide resolved
Copy link
Contributor

@cdrage cdrage left a comment

Choose a reason for hiding this comment

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

Approved, but let's open an issue for refactoring / fixing the bug with await new Promise(r => setTimeout(r, 100));

@cdrage cdrage enabled auto-merge (squash) March 28, 2024 19:24
@cdrage cdrage merged commit b0d4b6e into podman-desktop:main Mar 28, 2024
4 checks passed
@deboer-tim deboer-tim deleted the form-view-only branch April 2, 2024 21:28
cbr7 pushed a commit to cbr7/podman-desktop-extension-bootc that referenced this pull request Apr 11, 2024
* feat: open webview from image action

Removes the quick pick command, and instead triggers opening the webview, switching to
the build page, and preselecting the image.

Signed-off-by: Tim deBoer <[email protected]>

* chore: add tests

Adding tests for the command redirecting to the build page, and for the build
page allowing an initial selection.

To test a select control the values must be strings, so I had to rework the
Build page a bit to use string values.

Signed-off-by: Tim deBoer <[email protected]>

* chore: respond to review comments

Signed-off-by: Tim deBoer <[email protected]>

---------

Signed-off-by: Tim deBoer <[email protected]>
Signed-off-by: Vladimir Lazar <[email protected]>
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.

3 participants