[Feature]: Show page-span indicators in the document outline sidebar
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 53.9k
- Forks
- 10.7k
- Avg merge
- 18h 38m
- Merged PRs (30d)
- 130
Description
Is the feature relevant to the Firefox PDF Viewer?
Yes
Feature description
For long PDFs, the document outline shows the hierarchy of sections, but it is hard to quickly understand how much of the document each outline item occupies. A lightweight visual page-span indicator in the outline sidebar would make long technical books, manuals, and papers easier to navigate.
The proposed UI is a small, non-intrusive bar shown next to each outline item, either in a left gutter or on the right side of the item. The bar would represent the relative page span covered by that outline item.
For example:
- top-level outline items could show their span relative to the whole document;
- nested outline items could optionally show their span relative to the parent section;
- the indicator should stay subtle and not replace the existing outline title, expand/collapse controls, or current-outline-item highlight.
This is useful because a reader can immediately distinguish a short preface, a small appendix, and a very large chapter without expanding many nested items or jumping around the document.
Current workarounds are limited:
- use thumbnails, which show page count but not semantic structure;
- use the outline, which shows structure but not section length;
- manually jump through outline entries and infer length from page numbers.
A possible implementation could compute each outline item's start page from its destination and infer its end page from the next relevant outline item, then render a proportional CSS bar. Since similar outline-to-page mapping can be expensive for large documents, this should probably be initialized lazily when the outline view is opened, and should avoid triggering unnecessary data fetching. It may also need to be disabled or degraded when disableAutoFetch is set, similar to the current-outline-item feature.
Related context:
- #7557 and #12777 added support for finding/highlighting the outline item corresponding to the current page.
- #7713 and #20506 discuss long document outlines and the difficulty of navigating large expanded outlines.
- #20495 and #20739 show that the sidebar UI is actively evolving and that outline/sidebar usability matters for reading workflows.
Other PDF viewers
I am not aware of another PDF viewer that implements exactly this. The intended effect is a subtle page-span bar behind or beside outline items, making chapter size visible at a glance.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the Firefox PDF Viewer outline sidebar and the existing current-outline-item implementation referenced through issues #7557 and #12777. Determine how outline destinations map to pages, how lazy initialization and disableAutoFetch should behave, and how the indicator coexists with highlighting and controls. Done means subtle proportional spans appear for supported outline items without unnecessary fetching or disrupting navigation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100