feat(desktop): Slack-style in-app preview for generic file attachments - #23
Merged
Merged
Conversation
Clicking a FileCard now opens an in-app preview dialog (name, type, size, Close, Download) instead of immediately invoking the native save dialog. Markdown uses the existing sanitized chat renderer; HTML is inert source only and is never given to webview navigation or an iframe. Other text types get a scrollable preview; binaries keep chrome plus a no-preview state. Bytes still load through fetch_media_bytes / download_file. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: jmfcamp <jmfcamp@users.noreply.github.com>
…e row Forum post cards wrap Markdown in a row button. The FileCard click was bubbling, navigating away, and unmounting the preview before it opened. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: jmfcamp <jmfcamp@users.noreply.github.com>
jmfcamp
marked this pull request as ready for review
August 20, 2026 23:23
This was referenced Aug 20, 2026
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
Generic file attachments (
.md,.html, PDF, zip, …) used to open the native save dialog on FileCard click. This change matches Slack-style behavior: click opens an in-app preview window; Download stays available from that window.Images and video are unchanged (lightbox / player). Relay
serve_inlineand MIME deny lists are unchanged — HTML stays an inert download on the wire (block/buzz#5569).Preview routing:
.md/text/markdown) — existing sanitized chat markdown pipeline (interactive={false}).html/.htm/text/html) — inert syntax-highlighted source only. No<iframe>, nosrcdoc, no webview navigation to/media/(stored-XSS)text/plain, CSV, JSON, sniffed UTF-8 octet-stream) — scrollable previewfetch_media_bytes/download_file, never<a href>FileCard clicks
stopPropagation()so a preview opened from a forum post card (or any other clickable row) is not immediately unmounted by the row’s own click handler.Hula Buzz branding (
productName,com.huladesk.buzz,hulabuzz://) is untouched.Related issue
None found in this fork. Closest official context: block/buzz#5569 (HTML accepted as inert download).
Testing
desktop/src/shared/ui/filePreview.test.mjs— md/html/text/binary routing, size cap, UTF-8 sniff, and “HTML is never a webview navigation / unsandboxed iframe”resolveFileCardnow forwards imeta MIME for preview routingtsc --noEmitpassedfile-attachment.spec.ts:download_file; Escape dismissesstopPropagationfix)<script>does not run in the app webview