Skip to content

Page numbers in Kindle popup#1147

Merged
samuelclay merged 138 commits intomainfrom
sam/kindle-page-numbers
Dec 12, 2025
Merged

Page numbers in Kindle popup#1147
samuelclay merged 138 commits intomainfrom
sam/kindle-page-numbers

Conversation

@samuelclay
Copy link
Copy Markdown
Contributor

Page X of Y. This is more of a server-side change than client, but apart from turning it on, I had to handle compatibility with regular readables.

Screenshot 2025-09-26 at 10 12 09 AM

Note that we don't show a page number when the server returns locations instead of pages, which happens on more EPUBs than I would have thought. Kindle is stricter about EPUB page numbers, so instead we could treat locations like Sol EPUB bytes and divide them by 1000 and get a ~Sol page number. WDYT?

Screenshot 2025-09-26 at 10 06 26 AM

samuelclay and others added 30 commits August 16, 2025 07:50
* main:
  2000 byte buffer for Kindle previewing (#1142)
  No more partial pages in Kindle (#1137)
  Bookmark telemetry (#1140)
  Adding dark mode telemetry to popup menu (#1141)
…y too far, beyond where we are in the buffer.
…adding jump bool to know if we need to jump ahead becuase user navigated while waiting on server.
Copy link
Copy Markdown
Contributor

@johnboiles johnboiles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead we could treat locations like Sol EPUB bytes and divide them by 1000 and get a ~Sol page number. WDYT

To me it depends on whether Kindle locations are consistent. Does it seem to roughly correlate with the amount of text?

Base automatically changed from sam/kindle-toc to main September 29, 2025 21:40
@samuelclay
Copy link
Copy Markdown
Contributor Author

To me it depends on whether Kindle locations are consistent. Does it seem to roughly correlate with the amount of text?

It's pretty close. Here's the same epub in both our format and kindle. Note that the start/end bytes are from the .txt extraction from the .epub, which is a larger number (and to the right). We use the epub byte offset for page numbers, but since we aren't just / 1000 the byte count to get a page count, we can either show Location 953 of 13959 or Page 95 of 1395 (or whatever the devisor we decide)

Screenshot 2025-09-30 at 4 52 22 PM Screenshot 2025-09-30 at 4 50 34 PM Screenshot 2025-09-30 at 4 52 48 PM

And at the end, it becomes Location 13422 of 13959 vs Page 1210 of 1271:

Screenshot 2025-09-30 at 4 56 55 PM Screenshot 2025-09-30 at 4 57 12 PM

@samuelclay
Copy link
Copy Markdown
Contributor Author

samuelclay commented Oct 1, 2025

To be clear (since there's a lot to parse above), I propose we don't show Location but instead convert to our Pages.

For the "Rich Men" article, native EPUB would show Page 1210 of 1271 and Kindle would show Page 1342 of 1395.

Or should it say Location and not convert at all? The full Location 13422 of 13959

@samuelclay
Copy link
Copy Markdown
Contributor Author

I'm going to punt on handling location and just get pages working for books that support it.

samuelclay and others added 2 commits October 8, 2025 10:09
…t read page..." dialog screenshots. It fails intermittently with these two, even though the images come back correct.
@samuelclay samuelclay merged commit c3ba3fd into main Dec 12, 2025
13 checks passed
@samuelclay
Copy link
Copy Markdown
Contributor Author

Servers already giving these page numbers, and since we're now public, this gets merged.

@samuelclay samuelclay deleted the sam/kindle-page-numbers branch December 12, 2025 18:30
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