Plugin API Request: hide a dialog

It seems that joplin.view.panels.hide only works for panel. Can we provide a similar API for dialog?

Dialogs are modal so I doubt it.

It's very common to control modal's visibility by developers, in almost every UI library. In my use case, I want to use my custom button as cancel button, instead of Joplin default button.

Either I'm missing something, but a modal dialog is on top of all other windows and blocks the main app until it is dismissed. So why do you want to make it invisible?

  1. Modal is not only a blocker, but also can be used as an UI container, just like panels.
  2. Even if we only take modals as blocker, it would be better if plugin developers can put their own buttons as ok/cancel button(on proper position and proper timing), instead of Joplin default buttons. In order to make custom cancel button take effect, an API like joplin.view.dialog.hide is necesary, so we can make a postMessage request from dialog view to main script, to hide the dialog.

I guess I am too old. When I grew up a modal dialog was blocking.

Anyway, I guess Laurent would have to continue here, because I am not sure what you are talking about. Afaik you can define your own buttons, but maybe I mix this up with core.