Skip to content

Cite does not appear when selecting text inside an HTML render in the chat #33039

Open

Description

@lol2x

What happened

I asked the agent to "do a html mockup". The mockup rendered in the chat as an HTML render. When I select text inside it, the Cite option never appears, so I cannot quote anything from the visualization into the composer. Cite works fine on normal assistant text.

Diagnosis

HTML renders are their own timeline row (html-render), loaded through HtmlRenderFrame -> HtmlRenderDocument into a sandboxed iframe (sandbox="allow-scripts allow-forms", no allow-same-origin, so an opaque origin) in apps/web/src/components/files/BrowserDocumentFrame.tsx.

AssistantSelectionToolbar (apps/web/src/components/chat/AssistantSelectionToolbar.tsx:55-61) reads window.getSelection() of the host document and calls captureAssistantTextSelection, which only accepts selections inside an element with data-assistant-citation-source. A selection inside the iframe belongs to the frame's own document, so the host never sees it and the toolbar stays hidden.

The frame bridge already exchanges messages with the page over postMessage (theme, allowed/blocked shortcuts, link requests), but there is no message for text selection, so no path exists for Cite to receive it. The same applies to MCP app frames (McpAppFrame.tsx, same sandbox).

Keeping the sandbox makes sense; a possible direction is a selection message over the existing frame bridge (selected text plus a rect), with the host showing Cite and building a citation that points at the html-render row instead of an assistant message. Nothing on main touches this yet (checked recent commits to HtmlRenderFrame.tsx, BrowserDocumentFrame.tsx, AssistantSelectionToolbar.tsx).

Steps to reproduce

  1. In the desktop app, ask the agent: "do a html mockup".
  2. Wait for the HTML render to appear in the chat timeline.
  3. Drag to select some text inside the render.
  4. Expected: the Cite button appears, like it does for normal assistant text.
  5. Actual: no Cite button. Selecting normal assistant text in the same thread shows Cite as usual.

Version

0.1.8-nightly.20261107.4340 (desktop app, local server; triage CLI was 0.1.7)

Environment

Windows 11 Pro 10.0.26300 x64, Node v26.12.1, desktop app against local server

Evidence

No errors logged; this is a missing code path, not a crash.
BrowserDocumentFrame.tsx: <iframe sandbox="allow-scripts allow-forms" ...>  (HTML render document)
AssistantSelectionToolbar.tsx:55-58:
  const nativeSelection = window.getSelection();
  const captured = captureAssistantTextSelection(viewport, nativeSelection);
  const messageId = captured?.source.dataset.assistantCitationSource;
  if (!captured || !messageId) { clear(); return; }

Related issues

None are duplicates: #27666 (Cite slow to appear), #31782 (Cite to side chat), #29209 (unintended citations) all concern normal assistant text.

Fix applied or workaround

None applied. Workaround: copy text from the render with Ctrl+C and paste it into the composer, or ask the agent to restate key content as plain text so Cite works.

Filed by

Claude Code (claude-opus-5-5) via t3 triage

Activity

  1. added
    via-triage
    on Nov 8, 2026
  2. robin-liquidium commented on Nov 15, 2026

    @robin-liquidium

    Still reproduces on 0.1.10-nightly.20261113.4643 (Linux, web UI). Selecting any text inside an inline HTML render (html_render output) shows no Cite button, while the same selection in normal assistant text does. It matters most for long review pages rendered this way, where quoting a specific row back to the agent is the main way to give feedback.

  3. added a commit that references this issue on Nov 17, 2026
    19101b4
  4. makeavish commented on Nov 21, 2026

    @makeavish

    +1

  5. Pulsar-Programmer commented on Nov 23, 2026

    @Pulsar-Programmer
    Contributor

    +1. I’d use Cite to quote a particular table cell or caption from an assistant-generated HTML report into my follow-up, then jump back to the render from the citation. The inline flow in #33106 would cover that. I’d also use it in the full-screen render dialog, where I tend to read wider reports.

    GPT-6.2 Sol posting on behalf of Pulsar-Programmer.

  6. logan-hunt commented on Dec 2, 2026

    @logan-hunt

    +1 from a daily user on the nightly build. I read inline HTML renders in the chat all the time, and I keep wanting to cite a specific sentence or table row from one the same way I cite assistant text, so I can point the agent at exactly what I mean. Copy and paste works but loses the link back to the render. #33106 covers exactly this, and I'd love to see it land in an upcoming release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    via-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions