Skip to content

Conversation

@body-clock
Copy link

Closes #306

  • Move pluginsWithInfoPanel from InformationPanel to Viewer/Content (which renders InformationPanel), pass it as a prop (so it isn't called twice)
  • Refactored InformationPanel default tab selection logic to dynamically choose the first available tab (About, Annotation, Content Search, or Plugin) if no valid defaultTab is configured.
  • Ensured plugin-provided panels are included in available tab detection and default selection.
  • Made default tab selection responsive to changes in configuration, annotation resources, content search resource, and plugins (runs on relevant dependency updates).

availableTabs.includes(String(informationPanel.defaultTab)) &&
informationPanel.defaultTab) ||
availableTabs[0] ||
"manifest-about";
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering about this - is it worth falling back to a tab that just says something like "No tabs configured, consider adding one or disabling the toggle". Or maybe just disabling the toggle in this case?

@mathewjordan
Copy link
Member

mathewjordan commented Oct 31, 2025

Hi @body-clock. I've taken a peek at this and am seeing some issues with it automatically toggling back to the About tab if I attempted navigate to Annotations. I'll take a deeper look at other use cases but these are the two obvious ones I noted.

For example, try wiring up either of these resources:

vtt annotations for this item

https://api.dc.library.northwestern.edu/api/v2/works/40f87ae4-9666-4a8e-b6ce-a891096fefd3?as=iiif

content state link for this item (with an annotation)

JTdCJTIyJTQwY29udGV4dCUyMiUzQSUyMmh0dHAlM0ElMkYlMkZpaWlmLmlvJTJGYXBpJTJGcHJlc2VudGF0aW9uJTJGMyUyRmNvbnRleHQuanNvbiUyMiUyQyUyMmlkJTIyJTNBJTIyaHR0cHMlM0ElMkYlMkZhcGkuZGMubGlicmFyeS5ub3J0aHdlc3Rlcm4uZWR1JTJGYXBpJTJGdjIlMkZ3b3JrcyUyRjdjMDJiYWQwLTRjZmQtNGJmMy04YmU5LTg0MTczNjQ2MDNmYyUzRmFzJTNEaWlpZiUyRnN0YXRlJTJGLTEyOTk3NTMxNzIlMjIlMkMlMjJ0eXBlJTIyJTNBJTIyQW5ub3RhdGlvbiUyMiUyQyUyMm1vdGl2YXRpb24lMjIlM0ElNUIlMjJjb250ZW50U3Rh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DJTIyZm9ybWF0JTIyJTNBJTIydGV4dCUyRnBsYWluJTIyJTdEJTVEJTdE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor InformationPanel visibility logic to allow sidebar when any tab is present (including plugins)

2 participants