Skip to content

native: HTML render frames in assistant messages, first slice (TR-HTML) #87

Closed

Description

@rynfar

First slice of ledger row TR-HTML: render htmlRender attachments inline in assistant rows with an embedded web view (gpui-component's webview crate at the pinned rev), server-measured height, the fullscreen dialog, and open/save. Web sources: apps/web/src/components/chat/HtmlRenderFrame.tsx, HtmlRenderDialog.tsx, TimelineAssistantRows.tsx, packages/shared/src/htmlRender.ts, apps/web/src/components/files/BrowserDocumentFrame.tsx. TR-MCPAPP (MCP app frames + host bridge) builds on this web view in a later slice.

Activity

  1. added this to the M2 Parity core milestone on Nov 2, 2026
  2. added
    parity
    native:feature
    status:in-progress
    status:review
    and removed
    status:in-progress
    on Nov 2, 2026
  3. rynfar commented on Nov 3, 2026

    @rynfar
    OwnerAuthor

    First slice is up in #91. TR-HTML stays partial.

    What shipped:

    • Inline WKWebView frames sized to the page's reported height, with the full-screen view and zoom.
    • A reusable webview/ wrapper with a sandboxed in-memory page, an incognito store, and z-order handled through zui's scene overlay plus occluders. TR-MCPAPP can build on it.

    Remaining gaps:

    • Pages get the default T3 palette in light or dark mode, on the active theme's canvas. Named-theme colors and font settings aren't passed yet.
    • No forwarding of app shortcuts from a focused page (t3/notifications/shortcuts / keydown).
    • No image viewer from inside a page (t3/notifications/open-image).
    • Links open in the default browser, not the in-app browser, and change-request links aren't routed.
    • Cmd+C inside a page may be taken by GPUI.
    • Inner vertical scroll areas don't wheel-scroll inline (they do in full screen).
    • "Open full screen" sits under the frame, not hover-revealed on it.
    • Full screen doesn't pin the timeline follow, and stays open across a thread switch.
    • No downloads.
    • Not exercised with real input: clicks, typing, links, the wheel hand-off, menus over a page.
  4. rynfar commented on Nov 3, 2026

    @rynfar
    OwnerAuthor

    First slice merged in #91 (TR-HTML stays partial). Shipped: sandboxed WebKit view per visible row (exact-document main frame, CSP on every response, IPC only from the page), server-measured + content height, full-screen view with zoom, overlays occlude the page, clicked links open in the browser. Remaining gaps: named-theme colors and reader fonts inside the page, app shortcuts while a page has focus, the image viewer, in-app links, downloads, remote iframes. Not exercised: clicks, typing, scrolling the transcript over a page, menus over a page (synthetic input is dropped). TR-MCPAPP builds on crates/app/src/webview.

  5. added
    status:in-progress
    and removed
    status:review
    on Nov 3, 2026
  6. rynfar commented on Nov 3, 2026

    @rynfar
    OwnerAuthor

    Follow-up slice: #176 (head f149d9366890f51ed4b98af31b86dce371ca8155, rebased onto native 64f645b701).

    TR-HTML remains partial. This slice adds live named-theme colours and reader fonts, the safe view-shortcut bridge, and browser/PR preference routing. The review fixes carry the rendered transcript's scoped owner through inline/fullscreen routing, require a readable project for PR interception, and reject stale, unfocused, inactive and raw navigation requests at a tested core boundary. HTML now matches web's scripts/forms sandbox; page-only IPC and the exact-document navigation lock remain intact. Size notifications stay focus-independent, as on web. Forgejo projects without webUrl now compare the HTTP remote authority including its port in both repository and host-lending paths; default-port links fall through when the configured remote uses another port. With a resolved webUrl, repository matching still requires clone-authority agreement, while host lending uses only the resolved web authority and mount. The existing provider/port test covers both without-webUrl strict port handling and the clone-port/webUrl lending regression; both failed before their fixes.

    Remaining gaps and exceptions:

    • Page image viewer, downloads, remote iframe parity/verification, and commit-link diff previews.
    • Native model-picker jumps, Cmd+C ownership, inline inner scrolling, hover-positioned fullscreen controls, timeline follow pin and automatic fullscreen close on thread changes.
    • Resolved PRs use native's standalone PR page; per-thread PR tabs remain missing. Context chips share the readable-project resolver but their fallback uses the system browser. The native fallback card's explicit asset-open action is outside the page bridge. View shortcuts remain workspace commands.
    • MCP retains its previous native popup/raw-navigation behavior; web MCP forbids popups. This existing difference is left with native: MCP app frames and host bridge (TR-MCPAPP) #98.

    Verification: 1,220 workspace tests, clippy, snapshot build, theme generation, parity sync and conformance generation passed. Failing-first cases cover ownership, activity, focus, stale pages, raw events, controller selection and readable-project resolution. Named-theme light/dark and same-page live-update evidence is in /private/tmp/native-87-evidence/review-{dark,light}.html.png and /private/tmp/native-87-evidence/review-live-update.png (computed styles and retained mounted marker in its .json).

    Unexercised: trusted WebKit clicks, typing, shortcut delivery, actual browser/PR opens, wheel handoff and menus over a page. Synthetic WebKit input is dropped. No real window, paid turn, download, clipboard use, new server or live-home write was used.

    Current resolver regression and gate evidence: /private/tmp/native-87-evidence/forgejo-web-lending-red.log, /private/tmp/native-87-evidence/forgejo-web-lending-green.log, /private/tmp/native-87-evidence/forgejo-web-lending-tests.log, /private/tmp/native-87-evidence/forgejo-web-lending-clippy.log, /private/tmp/native-87-evidence/forgejo-web-lending-build.log.

  7. added
    status:review
    and removed
    status:in-progress
    status:review
    on Nov 3, 2026
  8. rynfar commented on Nov 3, 2026

    @rynfar
    OwnerAuthor

    Second slice merged in #176 (squash 1e319fdc25): HTML pages follow the reader's named theme and fonts live, allowlisted view shortcuts reach the app while a page has focus, and links route by the owning thread through the browser preference and a readable-project PR resolver (also used by context chips). HTML pages now use web's allow-scripts allow-forms sandbox and raw navigations go through the same guard. TR-HTML stays partial.

    Remaining on this issue: page image viewer, downloads, remote iframe parity, per-thread PR tabs, commit-link previews, native model-picker jump commands, Cmd+C ownership, inner wheel scrolling, hover-positioned fullscreen control, timeline follow pin, closing fullscreen on thread change. Documented exceptions: MCP app frames keep their popup policy; context chips fall back to the system browser. Unverified: trusted WebKit clicks/typing/shortcut delivery, real link opens, wheel and menus over a page.

  9. rynfar commented on Nov 14, 2026

    @rynfar
    OwnerAuthor

    Closed by PR #363 (merged into native at ce0d652bc022c0492ebc275cbd476cfc32da3f28).

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

    native:featureparity

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions