stashapp/stash

[Feature] UI Plugin API Improvements

Opened this issue · 8 comments

Per WP's suggestion, this is an issue for plugin developers to request improvements to the UI plugin API. This single issue would be used to keep requests in one place.

My current requests (completed):

  • Date picker support
  • Country dropdown select (display countries with flags)
  • Tag dropdown select (includes tag previews and pill badges)

Edit: Updated for cleanliness and to mark as completed.

We need functionality to move and create elements to all parts of all pages so that those who work on making themes and scripts can fulfill their creative ideas.

  • A way for plugins to provide custom mutations and subscriptions that can be executed and subscribed to by the UI. I currently work around this using tasks but I have to hide the ones that require arguments from the tasks page and I also need to poll the logs to be able to receive any output and have the UI act on it.

  • A "multiple" plugin config setting property in addition to the "description" and "type" setting properties. A multiple value of true would indicate that the setting is a list of values rather than a single value. I currently work around this by allowing for comma-separated strings for multiple values, but it would be nice if the UI showed a list input for these kinds of settings.

  • A "visible" plugin config setting property to control whether a setting is shown in the UI. This can currently be worked around by hiding the element through the UI script. Nevermind, this is already supported

  • Additional plugin config setting types like date, country, tag, studio, performer, tag, etc. that would use those specialized input components OR allow config settings to be hooked so the UI plugin can replace the text inputs with the specialized input components.

Another request: Scene page as a patched component, with access to some of the current components on that page. I think the essentials I would need are the video player and... maybe the queue? I think if I had those I'd have a good amount to work with. Extra tooling like the tab/pane functionality could be useful, but lower priority.

Text blocks as a type to allow for users to create more complex configurations for things like pathParser without needing to edit the plugin code manually which should hopefully be on the way out with a built-in installer.

Can I get a confirmation: when I register a route, that route can only be viewed when navigating from an existing one. I cannot view the page by visiting localhost:9999/plugin/test-route on its own. Doing that or refreshing the page throws a 404.

Thanks for adding the PerformerDetailsPanel components, they're working nicely. Could I request the PerformerCard and TagCard components as well, if that's okay?

Thanks

Also, for some reason play_history and last_played_at are not available on a plugin GQL query. Here's a snapshot of my console log if it helps.

Hopefully this is the best place to raise this - apologies if not.

image

Sorry to keep asking for stuff! It would also be useful to have a defaultSettings option in the plugin yaml so that we can set defaults there. This would be similar to the defaultArgs option in plugin Hook configuration.

Currently, default values are 0, false, or "" as the settings are undefined. There are cases where it would be better to have different values as default, however.

Thanks