You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The viewer reads a document one page at a time: ◀ ▶, PageUp/PageDown, or a search hit. On a 300-page scan an archivist cannot jump to a page they already know, cannot see where they are in the document, and has no way to fit a tall page to the frame's width. This task is the PDF phase that was split off from the viewer improvements in #142.
Scope
In scope: go to a page by number, a page thumbnail strip, and fit to width, in the overlay and in the pop-out viewer. These apply to PDFs and multi-page TIFFs, which are the two formats preview::page_count counts.
Out of scope:
Continuous scrolling through pages. It needs a virtualised list of rendered pages, which is a larger change.
Rotating a page while keeping search highlights on it. Today a rotated page shows no highlights.
Colour management (ICC profiles).
Task Details
Go to page: make the "Page N of M" readout in the bottom pill editable. Enter jumps to the page and Escape cancels. Numbers are 1-based and clamped to the page count, and the jump goes through Viewer::show_page so the zoom and pan reset the same way they do today.
Page strip: a collapsible column of page thumbnails. Each page is preview::source(path, CARD, page, 0), so the pages are cached on disk and counted in the memory budget. The strip scrolls to keep the current page in view, and a click calls show_page.
Use a virtualised list (uniform_list), because a 300-page document must not render 300 thumbnails at once.
In the pop-out, decide whether the strip lives in the stage or as a sidebar tab next to Details | Find.
Fit to width: a zoom preset beside the fit/1:1 readout, with the pan starting at the top of the page. This needs the page's aspect ratio. preview::dimensions returns None for a PDF, so read the page size from PDFium, the same way pdf::decode does.
Definition of Done
Typing a page number jumps to that page. Values out of range are clamped.
The page strip shows every page without rendering pages that are off screen. The current page is highlighted and stays scrolled into view.
Fit to width works on PDFs and TIFF stacks.
All three work in the overlay and in the pop-out.
Tests for the page-jump parsing and clamping, and for fit-to-width zoom. ./scripts/ci.sh passes.
Activity
feat(workspace): go to a page by typing its number
feat(workspace): add a page strip beside multi-page documents
feat(workspace): fit a page to the viewer's width