The goal of this ticket was to facilitate an example of linking/scrolling from one location in a PDF document to another.
To achieve this, I made the following changes:
Added an optional ID prop to the BoundingBox component
Pulled out generic scrollTo(id) from existing scrollToPdfPage function
Demo in Reader showing how scrollTo can be used to scroll to a particular BoundingBox
Extra: Rearranged Header because the demo links were overflowing the container once I added the new "Scroll to Figure 1" example
Reviewer Instructions
Reader is continuing to get really messy with hard coded examples. I added TODOs to functions that I would like to remove once we nail down a working backend and UI design.
Testing Plan
Manual testing: Header displays "Scroll to Figure 1" link that scrolls to Figure 1 on click. Tested that all other menu items work as expected (noticed during testing: everything in header is working except the Outline is currently broken- not because of the work from this ticket though- subtask in https://github.com/allenai/scholar/issues/28926 for Drawer/Outline component will fix this).
Description
Ticket: https://github.com/allenai/scholar/issues/28697
The goal of this ticket was to facilitate an example of linking/scrolling from one location in a PDF document to another.
To achieve this, I made the following changes:
BoundingBox
componentscrollTo(id)
from existingscrollToPdfPage
functionReader
showing howscrollTo
can be used to scroll to a particularBoundingBox
Header
because the demo links were overflowing the container once I added the new "Scroll to Figure 1" exampleReviewer Instructions
Reader
is continuing to get really messy with hard coded examples. I added TODOs to functions that I would like to remove once we nail down a working backend and UI design.Testing Plan
Header
displays "Scroll to Figure 1" link that scrolls to Figure 1 on click. Tested that all other menu items work as expected (noticed during testing: everything in header is working except the Outline is currently broken- not because of the work from this ticket though- subtask in https://github.com/allenai/scholar/issues/28926 for Drawer/Outline component will fix this).Demo