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

Update Prune dialog to current design #2138

Merged
merged 2 commits into from
Apr 20, 2023

Conversation

deboer-tim
Copy link
Collaborator

What does this PR do?

Expose the message box API to the renderer (but not extensions) and switch the Prune dialog to use it. This changes the prune dialog to match current design guidelines.

Although we may still need to update the Modal component to the new design, this simplifies the prune code as well.

Screenshot/screencast of this PR

Before:
Screenshot 2023-04-18 at 10 18 58 AM

After:
Screenshot 2023-04-18 at 10 14 21 AM

What issues does this PR fix or reference?

Partial fix for issue #1987.

How to test this PR?

Prune! Try 'no', 'yes' and cancelling the dialog.

Expose the message box API to the renderer (but not extensions) and switch the Prune dialog to use it. This changes the prune dialog to match current design guidelines.

Although we may still need to update the Modal component to the new design, this simplifies the prune code as well.

Partial fix for issue containers#1987.

Signed-off-by: Tim deBoer <git@tdeboer.ca>
Signed-off-by: Tim deBoer <git@tdeboer.ca>
@deboer-tim deboer-tim requested review from a team and benoitf as code owners April 18, 2023 14:21
@deboer-tim deboer-tim requested review from jeffmaury and cdrage and removed request for a team April 18, 2023 14:21
message += ' from the ' + engines[0].name + ' engine.';
}

const result = await window.showMessageBox({
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering we should not align with the extension API that exposes showInformationMessage, showWarningMessage and showErrorMessage rather that showMessageBox which is lower level

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The message box API is slightly lower level, but it only requires one method instead of 4 variants (info/warn/error/question) and using properties is much more extendable. e.g. we could continue to add properties similar to Electron API (https://www.electronjs.org/docs/latest/api/dialog) and allow detailed messages, checkbox, assign default/cancel buttons, etc. For instance our old telemetry dialog would have required message box b/c it had a checkbox.

If you'd still prefer I can just expose a showQuestionBox (or all 4 variants) for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes you convinced me your choose the right path but maybe we should extend the extension API to have the same level.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I put that in the original MessageBox PR and Florent (correctly) pointed out I was doing too much in one PR and exposing API when we didn't really have a need for it yet. I think it's probably better to wait until we have a request (?) but I'm happy to do a separate PR for that whenever.

@deboer-tim deboer-tim merged commit 8af0a0f into containers:main Apr 20, 2023
@podman-desktop-bot podman-desktop-bot added this to the 0.15.0 milestone Apr 20, 2023
@deboer-tim deboer-tim deleted the prune-dialog branch May 4, 2023 18:13
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.

None yet

3 participants