Where the Plugin UI Renders
In Plugin Principles, we described the plugin event chain. After a button is tapped, the event is sent to PluginHost:
ReactRootView as the root container, which loads JS/TS and renders to the screen.
PluginHost also maintains a ReactRootView (or an equivalent container). All plugin UIs are mounted into this container; PluginHost uses the plugin identifier in the event to decide which plugin App entry to render.
Button Event Listener
Plugins can register multiple buttons. To distinguish “which button was pressed”, listen for button events and readid from the event.
registerButtonListener provides an event when the button is pressed. Common fields:
id to each button, and dispatch by id in the callback (e.g., switch (event.id)).