Destroying a plugin widget forces you back to the main game viewport tab

I expect calling Widget:Destroy() to just destroy the widget without affecting anything else in Studio. Instead it will kick the user back to the main game viewport.

2024-02-26_09-55-40

This is weird and annoying UX when developing plugins (because the act of reloading plugins will kick me back to the main viewport and out of whatever script I had open), but it affects plugin users as well if the plugin developer doesn’t account for this.

My plugins cannot destroy widgets because it is unacceptable UX to be kicked out of whatever scripts they have open, so I must implement alternatives instead, such as lazily creating the widget, then disabling/enabling it forever afterwards.

(Note: I avoid creating widgets proactively, as they will not be automatically brought to front if they are created beforehand and then enabled later, and creating a widget is the only mechanism we have right now to force a widget to be brought to the front.)

This also prevents us from creating a plugin which makes lots of temporary widgets, because they cannot be destroyed (if you want acceptable UX), and if they cannot be destroyed then you also cannot re-use them with same behaviour because they work differently as per the above note.

2 Likes

Thanks for the report! Just to confirm, we have a ticket filed for this issue and we’ll follow up when we have an update for you.

We will be taking a look at overhauling the plugin workflow later this year and will keep this case in mind.

2 Likes