Skip to content

Support navigation based on start URL parameter#204

Open
alea12 wants to merge 1 commit into
mainfrom
SCHOL-504/support-initial-page-number
Open

Support navigation based on start URL parameter#204
alea12 wants to merge 1 commit into
mainfrom
SCHOL-504/support-initial-page-number

Conversation

@alea12
Copy link
Copy Markdown
Member

@alea12 alea12 commented May 13, 2026

Refactored the reducer to handle the ?start URL parameter on load. The logic was moved from a utility function edge case in goToLocation() to the PDF_PARSED action for better consistency

@alea12 alea12 requested a review from jackiequach as a code owner May 13, 2026 17:42
@vercel
Copy link
Copy Markdown

vercel Bot commented May 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
web-reader Ready Ready Preview, Comment May 13, 2026 5:43pm

Request Review

Copy link
Copy Markdown
Collaborator

@jackiequach jackiequach left a comment

Choose a reason for hiding this comment

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

looks good, just a minor comment

Comment thread src/PdfReader/reducer.ts
const { pageNumber: currentPage, resourceIndex } = state;

const currentHref = manifest.readingOrder[resourceIndex]?.href;
const startPage = getStartPageFromHref(currentHref) ?? 0;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

startPage should default to 1 to be consistent with the rest of this reducer.

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