replit / desktop

Replit Desktop App
116 stars 7 forks source link

Add showMessageBox API #96

Closed sergeichestakov closed 1 year ago

sergeichestakov commented 1 year ago

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: https://github.com/replit/desktop/pull/58

Fixes WS-677

What changed

Add showMessageBox API

Test plan

Tested on web in a local branch

linear[bot] commented 1 year ago
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](https://linear.app/replit/issue/WS-302/figure-out-a-better-approach-to-before-unload))

sergeichestakov commented 1 year ago

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