mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-15 14:19:13 +02:00
* feat(editor): HTML attachments render like images (MUL-2345 v4) HTML attachments no longer wear the file-card chrome (icon + filename row). They now render as a sandboxed iframe with a hover-revealed right-top toolbar (Open / Download / Copy code), mirroring the image attachment visual model. - New HtmlAttachmentPreview owns the iframe + hover toolbar plus three states (loading / success / error). Failure mode keeps the toolbar pinned open and Open/Download enabled so the user is never stranded without an escape hatch — Copy code disables when the text body is unavailable. - New AttachmentBlock thin dispatcher picks the renderer per kind: html + attachmentId + !uploading -> HtmlAttachmentPreview, else AttachmentCard. All three entry points (file-card NodeView, readonly file-card, standalone AttachmentList) call AttachmentBlock, so feature work on a new kind only touches one place. - AttachmentCard collapses back to a pure file-card row UI: the inline HTML iframe branch (InlineHtmlIframe + inlineHtmlEnabled + showInlineHtml) is removed. - AttachmentBlock added to the editor barrel export. Sandbox/server-side defenses unchanged: sandbox="allow-scripts" (no allow-same-origin), srcDoc, server still returns text/plain + nosniff on the /content proxy. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Co-authored-by: multica-agent <github@multica.ai> * test(editor): pin three entry points to AttachmentBlock HTML route (MUL-2345) Reviewer flagged that the v4 dispatcher refactor only had tests on the shared AttachmentBlock + HtmlAttachmentPreview; the three real call sites at file-card.tsx:59, readonly-content.tsx:279, and comment-card.tsx:152 had no regression coverage. Reverting any one would silently lose the inline HTML iframe path — the exact MUL-2330 regression we're meant to be locking down. Each new test renders the real entry point with an HTML+attachmentId fixture and asserts the dispatched iframe (sandbox=allow-scripts, srcdoc) shows up while the AttachmentCard chrome (filename row) does not. FileCardView and AttachmentList are exported from their files for direct rendering, mirroring the existing CodeBlockView test pattern. Mutation-tested locally: temporarily flipping each site back to <AttachmentCard> turns its corresponding test red. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Co-authored-by: multica-agent <github@multica.ai> --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com> Co-authored-by: multica-agent <github@multica.ai>