Skip to content

fix(print): use native controls and full page width - #329

Draft
PathGao wants to merge 4 commits into
alecdotdev:masterfrom
PathGao:fix/print-split-layout
Draft

fix(print): use native controls and full page width#329
PathGao wants to merge 4 commits into
alecdotdev:masterfrom
PathGao:fix/print-split-layout

Conversation

@PathGao

@PathGao PathGao commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • restore the macOS/Linux native print sheet through Tauri WebviewWindow::print(); the browser-level window.print() path can silently do nothing in the bundled app
  • export directly to a user-chosen file through WebView2 on Windows, with print headers and footers disabled so PDFs do not contain tauri.localhost
  • retain the full-width print layout when exporting from split view
  • surface PDF-export failures as an in-app toast and bound the Windows completion wait to 60 seconds

Platform behavior

  • macOS/Linux: Export as PDF opens the native print sheet, including the platform's existing “Save as PDF…” flow.
  • Windows: Export as PDF opens a PDF save dialog, then uses WebView2 PrintToPdf with headers/footers disabled.

Validation

  • npm ci
  • npm run check — 0 errors, 0 warnings
  • npm test — 128 passing
  • cargo test
  • cargo check --target x86_64-pc-windows-msvc
  • built an isolated macOS release and exported the two reporter-provided stress documents from split view: the easy document was 29 A4 pages and the hard document was 92 A4 pages; inspected first, continuation, and table pages for full-width content and no URL footer.

Windows WebView2 output is compile-validated here; visual verification still needs a Windows runtime.

Related: #232

Depends on #337 until its test-only commit is merged.

@PathGao

PathGao commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

@alecdotdev This is the next linear follow-up after #327. It fixes a confirmed macOS PDF regression specific to exporting while split view is active: the viewer pane retained its inline split flex ratio, so the PDF body used only part of the printable page. I verified the minimal print-only change in an isolated release bundle with a 20-section A4 export. Please merge it after #327; I left it as a draft until that dependency lands.

@PathGao
PathGao force-pushed the fix/print-split-layout branch from 9ad1f07 to d4e040e Compare August 1, 2026 08:07
@PathGao PathGao changed the title Fix PDF width when exporting from split view fix(print): use full page width from split view Aug 1, 2026
@PathGao PathGao changed the title fix(print): use full page width from split view fix(print): use native controls and full page width Aug 1, 2026
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