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

Add showMessageBox API #96

Merged
merged 2 commits into from
Aug 9, 2023
Merged

Conversation

sergeichestakov
Copy link
Contributor

Why

A message box / dialog API would be generally useful any time we want to show or surface a native dialog to prompt the user from the web side. A concrete example of where this would be useful is if we want to replicate the behavior on web where we confirm if the user wants to leave the Repl (in the beforeunload handler) if the fs is still dirty. See this PR for context: #58

Fixes WS-677

What changed

Add showMessageBox API

Test plan

Tested on web in a local branch

@sergeichestakov sergeichestakov self-assigned this Aug 8, 2023
@linear
Copy link

linear bot commented Aug 8, 2023

WS-677 Add Dialog API

would be useful to allow web to show native dialogs to the user. for example, in the before unload event if fs status is not clean (see WS-302)

Copy link
Member

@szymonkaliski szymonkaliski left a comment

Choose a reason for hiding this comment

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

nice! curious why we have to type this manually, shouldn't this be part of electron types?

@sergeichestakov
Copy link
Contributor Author

yeah good point. I think the original thinking was because we only wanted to support a subset of the available options but I think we can do such gating on the web side and have the native client support them all in theory. fixed in latest commit

@sergeichestakov sergeichestakov merged commit 9fc9513 into main Aug 9, 2023
4 checks passed
@sergeichestakov sergeichestakov deleted the @sergeichestakov/add-dialog-api branch August 9, 2023 15:10
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.

2 participants