Skip to content

Add new Bookreader integration #6975

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

cdrini
Copy link
Contributor

@cdrini cdrini commented Apr 11, 2025

Adds bookreader support for hypothesis. Meaning that annotations made with hypothesis will now correctly persist on the correct page, and not become orphans as the user flips around and pages are dynamically rendered/destroyed in BookReader. Also the correctly page label is displayed, and a PageSelector and TextQuoteSelector are saved to the annotation.

Demo of it running in the BR development environment:

image

Testing

To test in the hypothesis dev-server:

  1. Start up the dev-server as per usual, and go to http://localhost:3000/document/bookreader
  2. Add annotations to the book.
  • The annotations should persist, and not convert to orphans as you flip around
  • The annotations should also persist on refresh.
  • They should persist when switching between 1up and 2up mode (hidden in thumbnail mode)
  • Clicking an annotation when not on its given page, navigates to that page.

@robertknight
Copy link
Member

As a heads up, the sorting by page is being implemented in #7002. As a result you can remove that code from this PR.

@cdrini cdrini force-pushed the bookreader-support branch from 5e8b766 to 99d9f71 Compare May 1, 2025 16:50
@cdrini cdrini force-pushed the bookreader-support branch from 99d9f71 to 9c1ebf0 Compare May 26, 2025 17:37
@cdrini cdrini force-pushed the bookreader-support branch from 9c1ebf0 to bc95911 Compare May 26, 2025 17:40
@cdrini cdrini force-pushed the bookreader-support branch from cc047d5 to 63a177b Compare May 27, 2025 15:50
@cdrini cdrini marked this pull request as ready for review May 27, 2025 15:50
Copy link

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the stale Used by https://github.com/probot/stale to label stale issues and pull requests before closing them label Jun 27, 2025
@robertknight robertknight removed the stale Used by https://github.com/probot/stale to label stale issues and pull requests before closing them label Jun 27, 2025
Copy link

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the stale Used by https://github.com/probot/stale to label stale issues and pull requests before closing them label Jul 28, 2025
@robertknight robertknight removed the stale Used by https://github.com/probot/stale to label stale issues and pull requests before closing them label Aug 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants