Skip to content

Fix PDF file handling in Peek preview#12

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-11
Draft

Fix PDF file handling in Peek preview#12
Copilot wants to merge 2 commits intomainfrom
copilot/fix-11

Conversation

Copy link

Copilot AI commented May 23, 2025

Issue

Peek was not displaying PDF files correctly. Users reported that Peek would become "out of order" when previewing PDF files, resulting in an unusable preview experience.

Root Cause

PDF files were being handled by the WebBrowserPreviewer component, which isn't optimized for displaying PDF documents. The WebBrowserPreviewer was intercepting PDF file preview requests before the more capable ShellPreviewHandlerPreviewer could handle them.

Solution

This PR makes a minimal change to fix the issue:

  • Removed .pdf extension from WebBrowserPreviewer's supported file types list

With this change, when a user attempts to preview a PDF file in Peek:

  1. WebBrowserPreviewer will no longer claim to support PDF files
  2. The preview request will flow to ShellPreviewHandlerPreviewer
  3. ShellPreviewHandlerPreviewer will use the system's native PDF preview handler (typically from Adobe Reader, Microsoft Edge, or another installed PDF viewer)

This ensures that PDF files are displayed properly using the system's registered PDF preview handler rather than attempting to render them with a component not designed for this purpose.

Fixes #11.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • cdn.fwupd.org
    • Triggering command: /usr/bin/fwupdmgr refresh (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: lei9444 <39758135+lei9444@users.noreply.github.com>
Copilot AI changed the title [WIP] Peek is out of order with PDF files. Fix PDF file handling in Peek preview May 23, 2025
Copilot AI requested a review from lei9444 May 23, 2025 13:14
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.

Peek is out of order with PDF files.

2 participants