Skip to content

feat(native): reach HTML render frame parity (TR-HTML) - #363

Merged
rynfar merged 1 commit into
nativefrom
nw/87-tr-html
Nov 14, 2026
Merged

rynfar merged 1 commit into
nativefrom
nw/87-tr-html

Conversation

@rynfar

@rynfar rynfar commented Nov 14, 2026

Copy link
Copy Markdown
Owner

Closes #87
Ref #244

Summary

Completes native HTML render frame parity (TR-HTML -> done):

  • Image click-to-viewer: html_host.js posts t3/notifications/open-image on trusted <img> clicks (unless inside a[href]/button or defaultPrevented); t3-core::html_render validates http(s):// / data:image/ (<= 16 MiB) and trims titles (ImageRequest / Action::OpenImage); html_render.rs releases WebView focus and opens MediaViewer.
  • Download navigation guard: PagePolicy::allows blocks WKNavigationAction::shouldPerformDownload() on macOS.
  • Cutout masking & hover-only inline expand: Inline expand sits inside the top-right (8px) of .group("html-render"), hidden while Slot::View is unhovered, masked via webview::cutout (T3WebContainerView::hitTest: + CALayer mask complement), and tracked by a local HoverTarget monitor (MouseMoved | MouseExited).
  • Scrollable container wheel pass-through: html_host.js reports scroll-areas (rAF-throttled + MutationObserver); webview::page_consumes_vertical_scroll and ScrollTarget::pass_through only consume vertical wheel events when the inner container or document can scroll in that direction.
  • Clipboard / Select-All shortcuts: menus.rs routes Cut/Copy/Paste/Select All through MenuItem::os_action (OsAction::*), and webview/macos.rs Activation forwards Cmd+X/C/V/A to the active responder when WKWebView owns focus.
  • Auto-close & live-follow pause: HtmlFullscreen closes when the owning thread/environment changes; ThreadView pauses live-follow (anchor::capture_pinned, deferred disclosure settling) whenever HtmlFullscreen or MediaViewer is open.

Snapshots (1440x900, --html-fixture)

Note: --snapshot renders offscreen (webview::is_offscreen() == true), showing the Slot::Card fallback with hovered top-right expand chrome. Live WebKit interactive DOM/mouse/keyboard events (hover, Cmd+C, wheel pass-through, <img> click) are covered by Rust/GPUI unit tests and manual macOS integration rather than headless WebKit driving.

Dark Light
Dark Light

Verification

  • cargo test --manifest-path apps/native/Cargo.toml -p t3-core -p t3-client: 1341 unit + 8 conformance tests (t3-core), 108 unit tests (t3-client) passed.
  • cargo clippy --manifest-path apps/native/Cargo.toml --workspace --all-targets -- -D warnings: passed (0 warnings/errors).
  • t3-native (--features snapshot, --test-threads=1, menus:: webview:: transcript:: thread_view::): 46 passed, 0 failed.
  • node --test apps/native/parity/sync.test.ts: 42/42 passed; vp fmt --check apps/native/parity/LEDGER.md: passed.

Completes native HTML render frame parity: WebKit image clicks to MediaViewer, download navigation guard, WebView cutout masking and hover tracking for the inline expand button, scrollable-container wheel pass-through, OS clipboard shortcuts via Edit menu actions, thread/environment switch auto-close, and live-follow pausing while full-screen HTML or media viewer is open.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant