Skip to content

fix: integrate Tao macOS lifecycle and borderless shadow fixes - #92

Merged
twlite merged 2 commits into
mainfrom
fix/tao-macos-integration
Nov 15, 2026
Merged

twlite merged 2 commits into
mainfrom
fix/tao-macos-integration

Conversation

@twlite

@twlite twlite commented Nov 15, 2026

Copy link
Copy Markdown
Member

Update the pinned Tao fork to 73ab3e94986f045ad379faee9b2560bffd84012c (webviewjs/tao#3) and exercise both reported macOS behaviors through the locally built N-API addon and public TypeScript API. Public API remains unchanged; the lockfile changes only the Tao and Tao macro Git sources.

Tao changes

The fork merges upstream dev through 2f60c2d5, preserving external pumping and fork dragging behavior. Upstream changes include macOS typed Objective-C class migrations, redraw reentrancy protection and borderless maximizable state, Linux theme notifications/system theme tracking, and Windows monitor selection for logical positions. No WebviewJS API adaptation was required by the merge.

  • 841ed17bd02911dfd74b4668acf628d3d3245c74: scope CF run-loop observers to EventLoop lifetime, avoiding stale callbacks/panics when an embedding host continues running after Tao destruction.
  • 002db4a9dca92d56b205e29a093f488d5ca85f06: explicitly apply both shadow values to NSWindow. Borderless windows with resizable/minimizable disabled default to no shadow in AppKit. WebviewJS already forwards macosHasShadow directly and does not override the setting, so the fix belongs in Tao.

Native reproductions

Related: github/copilot-cli#5398 and #91.

Added opt-in macOS integration tests, separate from the fake-binding runtime suite. A Bun parent serves localhost HTTP while fresh Node and Bun children own AppKit on their main thread. A watchdog kills a stuck child; finally blocks reap children, close the server, dispose windows/webviews and stop pumping. CI now builds and runs these native regressions on macos-latest.

  • Adapt the Copilot reproduction to local dist/index.js with whenReady({interval:50,ref:false}). Verify localhost, inline HTML and data URL DOM loading before another window or explicit focus intervention, JS evaluation/mutation, page timers, HTTP fetches, IPC, seven seconds without input, repeated manual event pumping, multiple windows, resizing, focus and cleanup.
  • Latest reproduction: Node roots=1, HTTP ticks=91, IPC=178, data JS ticks=68; Bun roots=1, HTTP ticks=87, IPC=172, data JS ticks=68. All three pages passed DOM mutation.
  • Shadow tests cover all 16 decorations/resizable/minimizable/shadow combinations after attaching a webview, style changes, explicit disabling and runtime shadow changes. The old 9bb2bdc addon fails the reported all-false-style/true-shadow combination under both Node and Bun; the updated addon passes.

Validation

Host: macOS 27.0.1 (26A434), ARM64, Node 24.22.1, Bun 1.4.4, Rust 1.99.1.

Passed locally:

  • Release build of the actual published package; generated bindings unchanged.
  • Native Node/Bun loading and shadow tests: 4 passed.
  • bun run test: 108 passed, 1 existing skip, including strict public API/example type fixtures.
  • bun run check, strict typecheck of the new test runner, bun run clippy with warnings denied.
  • cargo test --manifest-path packages/webview/Cargo.toml --lib: 21 passed.
  • bun run lint (one existing create-webview control-regex warning), bun run format:check, git diff --check.
  • cargo check for aarch64-apple-darwin, x86_64-apple-darwin and x86_64-pc-windows-msvc. Cross-checks are compilation checks, not linked executables or runtime validation.

Limits and remaining findings:

  • The macOS 26 blank-page stall did not reproduce on this macOS 27 host. This PR incorporates the proven lifecycle fix but does not claim the macOS 26 loading report is resolved. GitHub still needs to update its bundled WebviewJS dependency; this PR intentionally does not close the Copilot issue.
  • Wry 0.55.1 discards IPC from data URLs in its macOS delegate because http::Uri rejects opaque data URLs. Confirmed separately with the URI parser. Data navigation, DOM mutation and JS timers pass; IPC is asserted for HTTP and inline HTML. This separate Wry limitation remains unfixed and is documented in the integration README; no WebviewJS workaround or unrelated Wry upgrade was added.
  • Shadow state is checked through hasShadow(), not visual compositor measurement. macOS 15/26 and Windows runtime are untested.
  • Linux cross-compilation attempted but blocked by missing target pkg-config/sysroot (wayland-sys). Hosted native platform builds are pending; existing build validation covers macOS ARM64/x64, Windows and Linux targets.

@vercel

vercel Bot commented Nov 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
webview Ignored Ignored Nov 15, 2026 10:51am UTC

@twlite
twlite merged commit 43739fa into main Nov 15, 2026
16 checks passed
@twlite
twlite deleted the fix/tao-macos-integration branch November 19, 2026 13:54
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