Overview
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
Estimate
About 1–1.5 days.
Type
Feature
Notion: https://app.notion.com/p/Viewer-long-document-navigation-page-jump-page-strip-fit-width-3e921d32b13b81e2ae04d612d56cac51
Overview
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
preview::page_countcounts.Task Details
Viewer::show_pageso the zoom and pan reset the same way they do today.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 callsshow_page.uniform_list), because a 300-page document must not render 300 thumbnails at once.preview::dimensionsreturnsNonefor a PDF, so read the page size from PDFium, the same waypdf::decodedoes.Definition of Done
./scripts/ci.shpasses.Estimate
About 1–1.5 days.
Type
Feature
Notion: https://app.notion.com/p/Viewer-long-document-navigation-page-jump-page-strip-fit-width-3e921d32b13b81e2ae04d612d56cac51