feat(v2): inline artifact previews in inspector detail#271
Merged
Conversation
Adds an inline preview pane to the artifact detail sub-page so a member opening an artifact sees the content without leaving the inspector — the YC demo "the artifacts are in the room" beat. Files (signed-URL fetch, 200 KB cap on text reads): - image → <img> (existing signed-URL flow) - pdf → <iframe> (browsers render PDF natively) - md → ReactMarkdown render - txt → monospace <pre> - json → JSON.stringify pretty-print, fall through to raw on parse fail - csv → naive table render of first 20 rows - office / archive / unknown → no preview (Open button only) URL artifacts (iframe where the vendor allows it): - youtube → www.youtube.com/embed/<id> (handles youtu.be / watch / shorts) - loom → www.loom.com/embed/<id> - figma → www.figma.com/embed?url=<original> Notion / Drive / Docs / Sheets / Slides / GitHub stay click-through because each vendor returns X-Frame-Options=DENY for unauth viewers. Implementation: - Helpers `useSignedFileUrl` and `useTextPreview` keep the fetch / cache logic local — no new shared utilities until a 3rd consumer appears. - Text fetch uses ReadableStream so a 50 MB log file aborts mid-read rather than buffering then truncating. - All inline styles use var(--v2-*) tokens; no hardcoded hex. Out of scope (deferred): - Office docs preview (needs Office Online viewer or server-side LibreOffice — too heavy for the demo path) - Notion embed (vendor blocks iframe by default) - Click pill in chat → open inspector to artifact (would need V2PodChat → V2Layout handle wiring; new tab flow stays for now) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Adds an inline preview pane to the artifact detail sub-page so a member opening an artifact sees the content without leaving the inspector — the YC demo "the artifacts are in the room" beat.
Preview matrix
File uploads (signed-URL fetch, 200 KB cap on text reads):
URL artifacts (iframe where the vendor allows it):
Implementation notes
Out of scope (deferred)
Test plan
🤖 Generated with Claude Code