Figma Support Forum

Suggestion: Prevent plugin UI window from reloading

Quite a few of my plugins have the ability to run and show the UI based on what the user has selected. For example, previewing an icon in different sizes. In all of these cases, it would be a much better user experience if I could refresh the UI instead of closing the plugin UI window and reopening it.

As confirmed by @Gleb on the Slack plugin community, opening a plugin will always open a new instance of the plugin. I would like to request that either this functionality be changed so that if the same plugin is already opened a new instance is not created, OR some way to prevent a new instance from being created. This way I can give the user a better experience by refreshing the content of the plugin UI instead of reloading the window. :smiley:

1 Like

Yeah, that would be cool! Here are a couple more ways to solve this which I think would be neat, and probably even a bit more flexible, not limited to this use-case. Moreover I don’t think the current architecture would allow you to relaunch the plugin without relaunching the UI without massive architectural changes.

  1. The ability to run menu commands without restarting the plugin. In this case the user can either run another command like “refresh” and there will be a simple event like “onmessage” sent to the plugin. And in case of relaunching the plugin it would simply run the last command again and you will be able to catch it with a plugin.
  2. Allow the plugin to intercept shortcuts when the plugin window is not in focus. This way a plugin would be able to read any custom key combination for any action, like refreshing the plugin UI, and even more. This could be useful for so many plugins!
1 Like

Thanks Gleb, these ideas are great and both I’ve also had needs for, in the past. I’d like to add that with either of these I feel it is still important to be able to cater for the use-case when the user selects “Run last plugin”. As depending on the implementation, both of these suggestions could potentially still not cover this issue when the user selects this option from the menu.