Skip to content

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

@body-clock

Description

@body-clock

I have a chunk of time to work on OSS stuff, so I figured I'd tackle this minor annoyance. This issue prevents us from fully disabling the "About" panel (while keeping our Table of Contents structures plugin) in our DC app.

Currently, the InformationPanel sidebar only opens when renderAbout is true, or in a narrow annotation-specific "force open" case. If renderAbout is false - even with other tabs (like annotation or plugin panels) configured - the panel does not open and is non-functional.

Steps to Reproduce

  • Set renderAbout: false in the configuration.
    • The toggle button shows, but no panel opens.
  • Set renderAbout: false, renderAnnotation: true, and provide a manifest with annotations.
    • The panel still does not open, unless renderToggle: false (force open condition).
  • Add plugin panels with renderAbout: false.
    • The sidebar won't open, even if plugins provide tabs.

Root Cause

Panel visibility in the Viewer is currently gated by the following logic:

const isForcedAside =
  hasAnnotations && informationPanel?.renderAnnotation && informationPanel?.renderToggle === false && isInformationOpen;

const isAside =
  (informationPanel?.renderAbout && isInformationOpen) || isForcedAside;
  • The sidebar only opens if renderAbout is true and toggled open, or if the specific force annotation case is met.
  • Plugins and other tabs do not affect panel visibility.

Desired Behavior

  • The InformationPanel sidebar should open if any panel (About, Annotation, Content Search, Plugin) is configured and available.
  • isAside should depend on the presence of any configured panel, not just renderAbout.
  • The "force open" logic (isForcedAside) should consider all available panels, not just annotation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions