mirror of
https://github.com/readest/readest.git
synced 2026-11-29 19:02:28 +00:00
Curl and Page Flip on Android and iOS capture the next and previous pages with paginator.previewPage(), and the capture includes the bookmark ribbon overlaid on the page. The ribbon followed the current page, so the page revealed mid-turn carried the current page's ribbon state: a ribbon on a page without a bookmark, or none on one with it. Foliate's preview event now carries the previewed page's CFI (readest/foliate-js#206). FoliateViewer puts it in the page preview as its location, and while a preview is up, BookmarkPullDown matches that location against the book's bookmarks instead of the current page's state. The bookmark match moves into isLocationBookmarked in utils/cfi.ts, which BookmarkToggler now uses too. foliate-js is pinned at its main, 86522d9. The old pin fb174ec (#204) never reached foliate main: it was stacked on #203 and merged into #203's branch. readest/foliate-js#205 re-landed it unchanged, so the code diff from the old pin to this one is #206's view.js change alone. Verified: - Tests that fail without the change: in BookmarkPullDown.test.tsx, "shows the ribbon on a bookmarked page from a page that isn't" (expected null not to be null) and "hides the ribbon on a page without a bookmark, then brings it back" (expected <div…> to be null); the preview test in foliate-viewer-relocate.test.tsx (progress location was the current page's); and "previews the location a turn then reaches" in paginator-paginated.browser.test.ts at the old pin (no cfi in the preview). All pass with the change. - 13 related unit test files (218 tests) and the paginator-paginated browser file (37 tests) pass. pnpm lint and pnpm format:check pass. - dev-web, Alice EPUB: with a bookmark on one page, the ribbon at the moment each neighbour page is captured matches that page. With the preview event dropped, as on main, it shows the current page's state. - Android API 35 emulator, debug build, each turn held mid-way: Page Flip from a bookmarked page reveals a next page without a ribbon (it carried one before the fix); Curl from a page without a bookmark reveals the bookmarked page with its ribbon (none before the fix). Not run: iOS. It takes the same code path, but WKWebView takes the snapshots. Not reproduced: deleting a neighbouring page's bookmark from a pinned sidebar may leave an already-captured sheet with the old ribbon until the captures refresh. Reported by chrox on GitHub Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| foliate-js@86522d99b7 | ||
| js-mdict@d01bf62af8 | ||
| qcms@fc23a407f1 | ||
| simplecc-wasm@5e5b56f5b8 | ||
| swift-rs | ||
| tauri@382ea858bd | ||
| tauri-runtime-cef-stub | ||