PDF Viewer - Table of Contents (TOC) expansion icon displays incorrectly when content is not expanded

Steps to reproduce

  1. Open Obsidian.
  2. Right-click a PDF file in the file explorer.
  3. Ensure the PDF has a table of contents (TOC).
  4. Open the “Table of contents” pane if not already visible.

Did you follow the troubleshooting guide? [Y/N]

Y

Expected result

When a section in the PDF’s table of contents has sub-items but is currently in a collapsed state (i.e., its sub-items are not visible), the expansion icon (the arrow) should indicate a collapsed state (e.g., a right-pointing arrow or a triangle pointing right). When clicked, it should change to an expanded state icon (e.g., a down-pointing arrow or a triangle pointing down) and reveal the sub-items.

Actual result

The expansion icon (a down-pointing arrow) for each top-level (and potentially other un-expanded) section in the PDF table of contents consistently displays as “expanded” by default, even when the actual sub-items of that section are not visible. The sub-items only appear after I click the icon.

Additional information

The attached screenshot visually demonstrates the issue: the down-pointing arrows suggest the sections are already expanded, but their sub-items are not visible until clicked. This creates a minor UI inconsistency and makes it less intuitive to understand which sections are currently expanded or collapsed.


thanks