The Hypothesis sidebar currently groups annotations in VitalSource books by content document CFI and displays one title per group. For PDF-based books each page is treated by VS as a separate content document, and so gets a separate group and heading in the sidebar.
Record separately a CFI for the content document where the annotation was made, which will mean the page in a PDF-based book, and a CFI for the table of contents entry that corresponds to the current location. In EPUB-based books, there can be multiple TOC entries for the same content document. In PDF-based books there can be multiple content documents for the same TOC entry.
Hide headings which have the same text as the previous heading
The Hypothesis sidebar currently groups annotations in VitalSource books by content document CFI and displays one title per group. For PDF-based books each page is treated by VS as a separate content document, and so gets a separate group and heading in the sidebar.
This screenshot from https://bookshelf.vitalsource.com/reader/books/9781412993517 shows that annotating different pages in the same book chapter shows the same heading multiple times in the sidebar: