Skip to content

Add presets and a Paper Mode link to the PDF export dialog (DSK-245) - #637

Merged
QR-Madness merged 2 commits into
masterfrom
dsk-245-export-presets
Dec 1, 2026
Merged

QR-Madness merged 2 commits into
masterfrom
dsk-245-export-presets

Conversation

@QR-Madness

Copy link
Copy Markdown
Collaborator

What

The export dialog was a long list of settings. The founder rescoped DSK-245 on 2026-12-01: presets plus Paper Mode, which already shows the document as the PDF's real pages, instead of a second pdf.js preview inside the dialog.

  • Presets (src/ui/pdfExportPresets.ts, PdfPresetPicker.tsx):

    Preset Margins Furniture Images
    Report (the defaults, so the dialog opens on it) 20 mm contents, page X of Y, bookmarks high
    Paper 25 mm page numbers (X), bookmarks print
    Handout 12 mm none standard
    • A preset leaves the page size and orientation alone: A4 or Letter is a regional choice, and both are the document's page setup, which Paper Mode shares.
    • The cover page stays an advanced choice, because it needs a title and author.
    • The dialog marks the preset its settings match, or says Custom.
    • Each button is named by its preset and described by its line (aria-labelledby, aria-describedby).
  • "See these pages in Paper Mode", under the presets, makes the dialog's page setup the document's, turns Paper Mode on and closes the dialog. It's shown only where Paper Mode can show (Relaxed layout, writing on screen, wide enough). It was in the footer at first, which squeezed five buttons into stacked lines.

  • Advanced options: margins, page numbers, contents, outline, cover page and diagram settings fold under a collapsed section.

  • The guide (docs-site/guide/export-import.md) describes the presets, the link and the fold.

For your review: the preset values are my proposal. They're easy to change in one table.

Verification

  • Tests:
    • pdfExportPresets.test.ts (7): each preset's values; recognising each; a changed mix is Custom; the format is ignored while page numbers are off.
    • PdfPresetPicker.test.tsx (4): apply, the pressed state, Custom, names and descriptions; plus "See in Paper Mode" setting the document's page setup and turning Paper Mode on.
    • PDFExportDialog.presets.test.tsx (3), on the rendered dialog: it opens on Report; a preset sets the margins, page numbers, contents and outline; a change makes it Custom; the advanced settings are folded.
  • Mutations: 4 of 4 caught: a preset leaving the margins, or the contents; Advanced open by default; the matcher ignoring quality.
  • In the browser (local dev server):
    • The dialog opens on Report, highlighted.
    • Paper sets 25 mm margins and Print (300 DPI) quality, with contents off and bookmarks on.
    • The link closes the dialog and shows the document as Letter pages in Paper Mode.
    • Advanced options is folded.
  • Suites: tsc is clean; the suite passes 5,631 tests in 520 files; the docs link test passes. The OSS leak grep is clean.

Assisted-by: Opus 5.5

The dialog was a long list of settings. Rescoped by the founder: presets
plus Paper Mode, which already shows the document as the PDF's pages,
instead of a second preview inside the dialog.

- Presets: Report (the defaults: contents, page X of Y, bookmarks,
  high-quality images), Paper (wide margins, plain page numbers,
  print-quality images) and Handout (narrow margins, nothing extra,
  standard images). A preset sets the margins, the page furniture and the
  image quality, and leaves the page size and orientation alone. The
  dialog marks the preset its settings match, or says Custom.
- "See these pages in Paper Mode" makes the dialog's page setup the
  document's and turns Paper Mode on, where Paper Mode can show.
- Margins, page numbers, contents, outline, cover page and diagram
  settings fold under Advanced options.

Assisted-by: Opus 5.5
@QR-Madness
QR-Madness merged commit a35fdef into master Dec 1, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant