Add an opt-in PDF download opener - #2689
Open
banjerluke wants to merge 3 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
On my Android 13 eInk tablet (Boox Note Max), PDF links would open a side panel browser but wouldn't display, I assume due to platform limitations. The ideal flow on that device is to download the PDF, which sends it right into the Notes app where I can review and/or annotate it.
What was wrong
The file-opener system could select the built-in preview or a plugin viewer, but it had no first-class download action. This left users dependent on the browser’s PDF preview support, which is unreliable on some tablet browsers, without a persistent or one-off way to download the file.
What changed
.pdffiles under Settings → File openers.disposition=attachmentquery.Content-Dispositionfilenames with ASCII fallback and RFC 5987 UTF-8 encoding.How you verified
Added focused coverage for:
Content-Dispositionheaders.Commands run:
pnpm exec turbo run typecheck --filter=@bb/app --filter=@bb/server --filter=@bb/server-contractpnpm exec turbo run test --filter=@bb/app -- src/lib/file-download.test.ts src/components/secondary-panel/useThreadFileTabs.test.ts src/components/settings/FileOpenersSettingsSection.test.tsx src/lib/plugin-slot-resolvers.test.tspnpm exec turbo run test --filter=@bb/server -- test/hosts/daemon-file-response.test.ts test/public/public-thread-data.test.ts test/public/public-projects-local-host.test.tspnpm exec turbo run test --filter=@bb/server-contract -- test/contract.test.tspnpm exec turbo run buildThe focused suites passed with 34 app tests, 90 server tests, and 35 server-contract tests. The full build completed successfully with 18/18 tasks.
Fixes #