Skip to content

fix: show the file name and fit the page in PDF previews - #2093

Merged
Douglasymlai merged 7 commits into
mainfrom
fix/pdf-preview-title
Oct 26, 2026
Merged

Douglasymlai merged 7 commits into
mainfrom
fix/pdf-preview-title

Conversation

@Douglasymlai

@Douglasymlai Douglasymlai commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Pull Request

Related Issue

N/A — maintainer-directed repair; no linked issue required for this PR.

Description

Problem

The native PDF viewer displayed a generic “stream” title and could exceed a narrow preview pane.

Change

Give authorized local and streamed PDF URLs a filename path, retain the original file identity in the query, send an inline filename header for local responses, and default the native viewer to fit width. The preview can shrink within its pane while preserving native controls and byte ranges. Updated against current main.

Testing Evidence (REQUIRED)

  • 38 focused frontend tests and 15 backend file-controller tests passed, including Unicode filenames, signed URLs, explicit zoom, range responses, and frame failure/retry.
  • Type checking, focused ESLint/Prettier, and git diff --check passed.
  • Real Electron 33 runtime: production PdfPreview and the extracted production local-file protocol handler displayed “Quarterly report 中文.pdf”; both page edges remained visible at 740px and 420px pane widths and after returning to wide.
  • Existing iframe/preview layout retained; existing third-party-viewports exception used. No new primitives, semantic tokens, or exceptions.
  • Full packaged app, password-protected documents and the full theme/zoom matrix were not exercised.
  • Follow-up fix: a preview URL that cannot be parsed is passed through unchanged instead of throwing. 33 frontend tests pass.

Automated checks only; manual app testing is pending.

  • I have included human-verified testing evidence in this PR.
  • This PR includes frontend/UI changes, and I attached screenshot(s) or screen recording(s).
  • No frontend/UI changes in this PR.

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Contribution Guidelines Acknowledgement

@Douglasymlai Douglasymlai self-assigned this Oct 22, 2026
@Douglasymlai
Douglasymlai marked this pull request as ready for review October 22, 2026 21:48
@Douglasymlai
Douglasymlai merged commit b764e42 into main Oct 26, 2026
10 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