Repository navigation
fix(web): images outside the workspace preview from the file surface - #224
Merged
Merged
Conversation
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
WorkspaceImagePreview always requested a workspace-file asset, which the server confines to the workspace, so any host image failed with 'Unable to load workspace image.' It now picks media-file for paths outside the workspace, as the HTML/PDF preview already did.
Salochi
force-pushed
the
fix/host-image-preview
branch
from
October 16, 2026 13:13
4764dc6 to
a3700b7
Compare
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.
Problem
Opening an image that lives outside the thread's workspace in the file surface (for example
/home/me/previews/shot.pngfrom a chat link) shows "Unable to load workspace image." Video, audio, HTML and PDF files from the same folder preview fine.WorkspaceImagePreviewalways requested aworkspace-fileasset. The server confinesworkspace-fileto the workspace root (finalizeWorkspaceFileAsset→resolveRelativePathWithinRoot), so any host image was rejected. The HTML/PDF preview already pickedmedia-filefor paths outside the workspace; images were missed.This bug is also on upstream
main(pingdotgg/t3code,FilePreviewPanel.tsxstill hard-codeskind: "workspace-file"for images).Change
previewAssetKind(absolutePath, workspaceRoot)infilePreviewMode.ts:workspace-fileinside the workspace,media-fileoutside it.WorkspaceImagePreviewuses it, andWorkspaceBrowserPreviewnow shares it instead of its own inline copy of the check.No server change.
media-fileis already authorized underfilesystem:readand serves host media by extension, the same path videos, audio, HTML and PDFs outside the workspace use.Scope and approval
Small, focused fix for an obvious bug: one component used the wrong asset kind that its sibling previews already get right. Same permission and the same server path; nothing new is exposed.
Verification
vp test run apps/web/src/components/files/FilePreviewPanel.test.tspasses, with newpreviewAssetKindcases: inside the workspace, nested, outside it, a sibling folder with a matching prefix (/repo-sibling), and the root itself.tsc --noEmit -p apps/webpasses./home/aeris/projects/favicon-preview/(outside the thread's project) now preview in the file surface. Before, every one showed "Unable to load workspace image."mediaFileReferencelogic).No screenshot: the visible change is the error text being replaced by the image.
Model/harness: Claude Opus 5.5 via Hermes Agent (ACP) in T3 Code.