GeezerVison is showing github.com — fix(web): let users save a PDF after its preview fails by StiensWout · Pull Request #44980 · pingdotgg/t3code
Conversation
A workspace PDF that fails to preview now offers Save file in the error view. The action requests a fresh attachment grant, so users can download the PDF once it’s available, even when the PDF path points to a readable file with no extension. The regression scenario verifies the downloaded filename and bytes.
Related: #41519, #44896, #21564, #44438
Reproduction on main
Commit 75a1fcd5b1 (main), in the running web app:
- Start the web app and open a project that contains a PDF.
- Open the file picker and search for that PDF until it is listed.
- Move the PDF out of the project folder while that result is still listed.
- Open the PDF from that search result.
- When the preview says it cannot load the file, put the PDF back in its original place.
The preview says Unable to load file preview and has no Save file action. Expected: The failed preview offers Save file, so the PDF can be downloaded after it is available again.
The cause is at apps/web/src/components/files/FilePreviewPanel.tsx:1556. Ran pnpm scenarios:prove scripts/scenarios/failed-pdf-preview-can-still-save.e2e.ts --target web with the repro scenario added: it failed in 2 of 2 runs on a clean checkout, with expect.toBeVisible failed in the output.
Evidence
Environment: The web app in Chromium on Linux x64, a fresh checkout.
Proven: the repro fails at the test commit cdd2d441f5 and passes on the head 6652bbd721, both on main aedf477afa.
|
Before |
After |
| Commit |
cdd2d441f5 |
6652bbd721 |
| Result |
ASSERTION_FAILED: expect.toBeVisible failed |
passed |
| failed pdf preview |
 |
 |
| failure |
 |
|
Before the fix, recorded:
https://pub-b182a4071edc4521829926b34990540b.r2.dev/files/076f5c0b-bd13-44c3-be02-d7e97cdc8f49/before-recording.webm
After the fix, recorded:
https://pub-b182a4071edc4521829926b34990540b.r2.dev/files/88e01f63-e505-4af4-b107-38436630f794/after-recording.webm
Outside view: a person sees it in the running web app by following the steps under Reproduction on main.
Tests
- cdd2d441f5 adds the failing test, alone, before the fix.
pnpm exec vp run check:changed aedf477afa6ca25aa353ed5465d87151cbf541fc passed on head.
Not in this change
- Inline preview still requires a supported file type.
- This change covers the workspace PDF preview shared by web and desktop. Native mobile and chat attachments use separate preview paths.
Who did the work
- Repro written by GPT 6.2 Sol, in Codex
- Outside view by Grok 4.7, in Grok
- Duplicate check judged by Claude Opus 5.5, in Claude Code
- Written by GPT 6.2 Sol, in Codex
- Trimmed by Claude Opus 5.5, in Claude Code
- Reviewed by Claude Opus 5.5, in Claude Code, and by GPT 6.2 Sol, in Codex, and by Grok 4.7, in Grok
- Reproduction, checks and proof run by a program on base and head, not by an agent
Made in T3 Code by GPT 6.2 Sol, Claude Opus 5.5 and Grok 4.7
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Nov 28, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Walkthrough
-
PDF previews now retain a save action when asset URL loading fails. An end-to-end scenario checks that saving still downloads the original PDF bytes with the expected filename.
Changes: PDF Preview Save
| Layer / File(s) |
Summary |
PDF save action and validation apps/web/src/components/files/FilePreviewPanel.tsx, scripts/scenarios/failed-pdf-preview-can-still-save.e2e.ts |
The preview builds a save action using largeFileResource and passes it to BrowserDocumentFrame. When asset URL loading fails, the error view displays the action for PDFs. The end-to-end scenario checks the downloaded bytes and filename. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related issues
Suggested reviewers: juliusmarminge, only21mil
Merge Risk: Minimal · up to 312d6
-
Merge Risk: ⚪ Minimal · up to 312d6
The PDF preview error view now offers a save action that requests a fresh download grant. No concrete merge-blocking risk was found, and the change is small and easily reverted.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title "fix(web): let users save a PDF after its preview fails" matches the main change: the raw summary and objectives show a Save file action added to the PDF preview error view in the web app, w… |
| Description check |
 |
The description follows the template's sections (Problem, Change, Scope, Verification) and fills each with specific content. Problem: a failed workspace PDF preview offers no Save file action, with re… |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
Full details: Title check
-
Explanation
The title "fix(web): let users save a PDF after its preview fails" matches the main change: the raw summary and objectives show a Save file action added to the PDF preview error view in the web app, with an e2e test for it. It is a conventional commit title in plain language and names the user-visible fix.
Full details: Description check
-
Explanation
The description follows the template's sections (Problem, Change, Scope, Verification) and fills each with specific content. Problem: a failed workspace PDF preview offers no Save file action, with reproduction steps and expected behavior. Change: the save action requests a fresh attachment grant, with a regression scenario checking filename and bytes. Scope: links related issues and says the change covers the workspace PDF preview only. Verification: gives before/after results, screenshots, recordings, and the commands run. The Scope section does not clearly state why no issue is needed beyond the related links, and the Change section does not explain the reason the desktop and web changes share one path. These gaps are minor.
Finishing Touches
-
Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between c6bc226 and 6652bbd.
Files selected for processing: 2
-
apps/web/src/components/files/FilePreviewPanel.tsx
scripts/scenarios/failed-pdf-preview-can-still-save.e2e.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
The automated pipeline stopped on this pull request and will not merge it:
the proof was not accepted:
- The before is not shown to be a bug: cbb559a614aa0607/001-draft-regular-restored-error.png and 3ef61874efc6d85d/002-draft-symlink-restored-error.png show a correctly rendered, centred 'Unable to load file preview.' error with nothing clipped, overlapping or wrong. A missing Save action in an error view is a feature gap, and the PR adds a visible control (download icon under the message).
- The app does not contradict itself: on base, the other 'Unable to load file preview.' failure view (WorkspaceLargeTextPreview -> FileSurfaceFailure) offers Retry, not Save. No maintainer comment on the PR or a linked issue calls the missing Save a bug; the only PR comment is from coderabbitai.
- The diff changes behaviour the captures do not show: the Save action on a successfully rendered PDF (pdfActions of BrowserDocumentFrame) now uses largeFileResource (media-file/attachment with threadId, or draft-workspace-file) instead of the inline workspaceAssetResource. No capture shows a successfully previewed PDF or its Save, and the persisted-thread resource path was never exercised (both downloads used an unsent draft).
- The real user-facing defect remains in every after frame: once the file is restored the preview stays stuck on 'Unable to load file preview.' with no retry. The fix adds a workaround control rather than removing a defect shown in the before.
It stays open for a person to finish or close.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This branch has not been deployed
No deployments
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:M
30-99 changed lines (additions + deletions).
takeover:blocked
Takeover blocked; reason in the PR body
vouch:trusted
Author is trusted by repo permissions or the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|