allenai / pdf-component-library

51 stars 5 forks source link

29449 Convert pageNumber references to pageIndex #38

Closed carolinepaulic closed 3 years ago

carolinepaulic commented 3 years ago

Description

This covers https://github.com/allenai/scholar/issues/29449 which is a subtask of the PDF Loose Ends ticket.

Since the beginning stages of the PDF Component Library, there has been some confusion on whether we reference PDF pages by pageIndex (0-indexed) or pageNumber (1-indexed). PDF.js often seems to prefer pageNumber, but will sometimes accept either pageNumber or pageIndex, which adds to the confusion.

My goal is to reduce ambiguity by moving forward with pageIndex and removing references to pageNumber where possible. This was successful for the following:

However, there were two places where it was not possible to entirely diverge from pageNumber, and in these situations, I attempted to minimize its usage:

Summary of changes in this PR:

Testing Plan

Screencast for sanity check even though nothing has changed from a UI perspective The GIF I created isn't showing up in my preview so here's a link as an alternative.