GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(web): let users save a PDF after its preview fails by StiensWout · Pull Request #44980 · pingdotgg/t3code

Conversation

@StiensWout

@StiensWout StiensWout commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

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:

  1. Start the web app and open a project that contains a PDF.
  2. Open the file picker and search for that PDF until it is listed.
  3. Move the PDF out of the project folder while that result is still listed.
  4. Open the PDF from that search result.
  5. 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 Before: failed pdf preview After: failed pdf preview
failure Before: 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.

All reactions
StiensWout and others added 4 commits November 28, 2026 14:12
@StiensWout @codex
test(web): reproduce missing save action after a PDF preview fails
cdd2d44
Co-authored-by: GPT 6.2 Sol <[email protected]>
@StiensWout @codex
fix(web): let users save a PDF after its preview fails
96227ce
Co-authored-by: GPT 6.2 Sol <[email protected]>
@StiensWout @codex
fix(web): request a download grant when saving workspace PDFs
e205908
Co-authored-by: GPT 6.2 Sol <[email protected]>
@StiensWout @claude
refactor(web): keep the largeFileResource name the PDF save action re…
6652bbd
…uses

Co-authored-by: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Nov 28, 2026
@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Explain Change →

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

  • Save file in the file panel gives no feedback while it buffers the whole file, so large downloads look like nothing happened #41519 — This issue concerns the same PDF save path, but this change does not add progress feedback or alter in-memory buffering.

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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed 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)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: pingdotgg/t3code
  • Branch: main
  • File: .coderabbit.config.ts
  • Commit: c6bc226
  • Layers: Repository TS config
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5473f677-396f-402b-88b2-779f7038050e
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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 28, 2026
@juliusmarminge @claude
Merge origin/main into wf/find-0b59dbc6048162755efe8855
312d663
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@juliusmarminge
juliusmarminge force-pushed the wf/find-0b59dbc6048162755efe8855 branch from 23ffd75 to 312d663 Compare November 28, 2026 13:44
@juliusmarminge

juliusmarminge commented Nov 28, 2026

Copy link
Copy Markdown
Member

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge added takeover:blocked Takeover blocked; reason in the PR body and removed takeover:in-progress A takeover lead is working on this PR labels Nov 28, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

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.

Projects

None yet

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.

2 participants

@StiensWout @juliusmarminge
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.