Repository navigation
Preview sandbox files in the chat - #926
Merged
Merged
Conversation
Show generated HTML, images, and PDFs in the thread, in a resizable side pane, and across the chat area without covering the app sidebar. Co-authored-by: Cursor <[email protected]>
innoavator
requested review from
govindavashishtha,
kumarsks619,
qaifi-tf,
sajal-truefoundry,
sayan-truefoundry and
vinit-truefoundry
as code owners
September 30, 2026 09:45
🦋 Changeset detectedLatest commit: 4241f45 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Save the sandbox path's filename, drop the pane when the local chat changes, and stop thumbnails from opening popups or submitting forms. Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
innoavator
requested review from
bhaveshpatel640,
chiragjn,
debajyoti-truefoundry,
heerambavi1998,
sr07asthana and
thesujai
as code owners
September 30, 2026 10:09
The images stay on the pull request via the earlier commit. They do not belong in the tree. Co-authored-by: Cursor <[email protected]>
sajal-truefoundry
approved these changes
Oct 1, 2026
sajal-truefoundry
enabled auto-merge (squash)
October 1, 2026 05:28
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 75d65a0. Configure here.
The preview host stays mounted, so the previous file was still painted and downloadable under the next title until the new load finished. Co-authored-by: Cursor <[email protected]>
4 of 5 tasks
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.

Summary
Screenshots
Markdown rendered in the side pane:
Full page HTML preview. The app sidebar stays, and chat history is collapsed:
Test plan
Note
Medium Risk
Untrusted assistant-generated HTML runs in sandboxed iframes with scripts enabled; mis-sandboxing could widen exposure, though popups and same-origin are omitted by design.
Overview
Assistant-generated sandbox artifacts can now be previewed in the thread instead of download-only. HTML, images, and PDFs show as inline thumbnail cards with enlarge/download; other files stay in the artifact chips but gain a Preview action that opens the same viewer.
Preview state is wired through new file preview context (turn-scoped sandbox loads, closes on thread/new-chat changes) with
FilePreviewHostbeside the chat in a resizable side pane, overlay on mobile/compact layouts, or full page within the chat column. Full-page mode hides the recent-chats drawer inSidebarLayoutwhile keeping the app rail. Content is classified by path/extension with size and binary guards; HTML uses sandboxed iframes (scripts/forms allowed, not same-origin/popups). Download is unchanged and can reuse bytes already fetched for preview.Reviewed by Cursor Bugbot for commit 4241f45. Bugbot is set up for automated code reviews on this repo. Configure here.