fix(reader): correct paginated CFI anchor jumps#454
Open
codedogQBY wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root Cause
Footnote hrefs and AI citation CFIs both resolve to an anchor Range/Element and then call the paginator's
scrollToAnchor. In paginated CSS-columns mode, the previous logic filtered rects with physicalx/y >= 0and converted iframe-local offsets directly to a spread page. That can pick the wrong rect in RTL/vertical/multi-column cases and misses the column offset when a section starts inside an existing spread, causing jumps to land one or more columns/pages away from the target.Validation
node --check packages/foliate-js/paginator.jspnpm --filter @readany/app-expo run build:readerpnpm --filter @readany/app-expo exec tsc --noEmitpnpm --filter app exec tsc --noEmitgit diff --checkNotes
pnpm exec biome check packages/foliate-js/paginator.jsstill fails on existing vendored-style lint rules in this file (single var declarators, assignment in expressions, string concatenation, etc.); the parse issue from the touched mapper code was removed.Fixes #197