ProjectMirador / mirador

An open-source, web-based 'multi-up' viewer that supports zoom-pan-rotate functionality, ability to display/compare simple images, and images with annotations.
https://projectmirador.org
Apache License 2.0
549 stars 258 forks source link

Design for plugin areas #2395

Closed charbugs closed 3 years ago

charbugs commented 5 years ago

We said there should be special places where plugins can add an icon. Currently there are two such places (WindowTopMenu and WorkspaceControlPanel) but the design is arbitrary at this point. What's the desired design for this places?

jvine commented 5 years ago

There is design for the WindowTopMenu hiding over in another plugin issue: #1985. The intent is to add items to the menu as icon+text or text-only menu options that can launch a dialog, open a toolbar, toggle a setting.

Screen Shot 2019-04-08 at 2 38 12 PM

For the WorkspaceControlPanel menu, #2376 might provide more context about where plugins can be added - basically, to either the Settings or Workspace options menu, depending on the character of the plugin. Again, the intent is that items will be added as icon+text or text-only options, not as icons alone.

charbugs commented 5 years ago

Oh, I missed that. Thank you for the link.

mejackreed commented 5 years ago

@charbugs Do you envision every component that needs to display plugins to separately implement PluginHook? I've started to look into #1985 and it seems like I will need that hook in OpenSeadragonViewer.

Should the HOC know how to do that in each place?

charbugs commented 5 years ago

Do you envision every component that needs to display plugins to separately implement PluginHook?

Yes (when it comes to add-plugins with UI). See https://github.com/ProjectMirador/mirador/pull/2299#issuecomment-475768564

Should the HOC know how to do that in each place?

Not sure if I understand right, but the HOC (PluginHoc in withStyle.js) is generic. It simply passes the add-plugins to the target and then it's up to the target the render or to ignore the plugin.