Repository navigation
feat: PageStrip, a virtualised strip of page thumbnails - #495
Merged
Merged
Conversation
A vertical or horizontal strip of page cards with numbers, a current-page outline and a scrollbar: the slide panel of PowerPoint / Keynote / Google Slides, the thumbnail sidebar of pdf.js. Generic: a page is a bitmap handed in with SetImage or painted by the DrawPage callback; NeedImage asks the host once per page when it comes within a page of the window; Invalidate keeps the stale bitmap on screen until the replacement arrives, so an edited document re-renders only its changed pages; MaxResident bounds the bitmaps kept in memory (the farthest are dropped and asked for again). Layout is a prefix-sum over per-page aspects, the window a binary search: the cost of a Draw does not depend on the page count (measured 181 us at 10 pages, 155 us at 500, 142 us at 100000). Current() is an Observable (click, keys Arrow/Page/Home/End, or the host); the strip scrolls to keep it visible. The selected outline keeps >= 3:1 against the strip in light and dark. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ntent on the cards Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
The go-slides playground wants a column of slide thumbnails beside the preview (PowerPoint / Keynote slide panel); the go-tex playground and any PDF viewer want the same. Nothing in the toolkit was a page strip (PagedView is a viewer, GalleryView is not virtualised).
PageStrip
A generic, virtualised strip of page cards, vertical or horizontal, with page numbers, a current-page outline and a scrollbar.
SetImage(i, rgba, w, h)bitmap, or theDrawPagecallback, else a numbered placeholder.NeedImage(i)fires once per page when it comes within a page of the window;Invalidate(i)keeps the stale bitmap until the replacement arrives (an edited document re-renders only the changed pages);MaxResidentbounds memory (farthest dropped, asked again on return).Current()Observable (click, Arrow/Page/Home/End, or the host); the strip scrolls to keep it visible. Outline >= 3:1 vs the strip (tested in 4 themes).scrollGeom,scrollDrag).Bibliography opened: pdf.js
pdf_thumbnail_view.js(THUMBNAIL_WIDTH = 126, per-view INITIAL/RUNNING/FINISHED rendering state),pdf_rendering_queue.js(visible views first), VS Codeminimap.tsfor the sibling minimap (#494).Tests: virtualisation (500 pages: only the window and one neighbour requested, once), image/DrawPage/placeholder, invalidate/evict, selection by click and keys, follow-the-selection, scrollbar drag/page/wheel, horizontal, aspects, edge cases, a11y, benchmark. 100% coverage.
Stacked on #494 (v0.331.0), rebased on main.
🤖 Generated with Claude Code