Skip to content

fix(preview): opt-in native WebView, off by default on Windows - #238

Closed
Tryanks wants to merge 1 commit into
mainfrom
fix/149-windows-preview-containment
Closed

fix(preview): opt-in native WebView, off by default on Windows#238
Tryanks wants to merge 1 commit into
mainfrom
fix/149-windows-preview-containment

Conversation

@Tryanks

@Tryanks Tryanks commented Aug 22, 2026

Copy link
Copy Markdown
Owner

Containment for #149: creating or using the embedded WebView2 preview on Windows can terminate the whole app, and preview is an optional feature.

  • New BrowserSettings.native_webview: Option<bool> — absent means platform default: enabled on macOS, disabled on Windows. Explicit override wins everywhere. Serde stays back-compatible (absent stays absent; settings files without the field are untouched).
  • ensure_webview never constructs a WebView while the effective setting is off; the panel reuses the existing unavailable state with a localized explanation (en + zh-CN), and re-enabling clears the settings-derived error without dropping real builder errors.
  • Open/Navigate MCP ops still open the panel and record the URL so the open-in-system-browser affordance works; all webview-dependent ops answer a clear unavailable error.
  • Settings → Browser gains the toggle; README and docs updated.
  • Tests: platform-parameterized effective-default logic, serde round-trip/back-compat, and patch-flow coverage.

Windows re-enable by default stays gated on understanding the WebView2 crash path (tracked in the issue history); this PR makes the default path crash-safe.

Real-device validation planned before merge: a dev-build artifact of this branch will be smoke-tested on a physical Windows 11 machine (launch, preview tab fallback, opt-in toggle, open/close/switch/quit).

Gates run locally: fmt / clippy -D warnings / full workspace tests — green.

Closes #149

🤖 Generated with Claude Code

…y default on Windows

WebView2 failures can take down the whole process on Windows, and preview
is optional. The native webview is now controlled by
BrowserSettings.native_webview (absent = platform default: on for macOS,
off for Windows). When disabled, the panel reuses the existing unavailable
path with a localized explanation, keeps URLs flowing to the store so
open-in-system-browser still works, and preview MCP ops answer with a
clear unavailable error.

Closes #149

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Tryanks
Tryanks force-pushed the fix/149-windows-preview-containment branch from c5952f0 to 7640c7d Compare August 22, 2026 13:52
@Tryanks

Tryanks commented Aug 22, 2026

Copy link
Copy Markdown
Owner Author

Withdrawn: disabling the WebView is containment, not a fix. Pivoting to root-cause diagnosis on real Windows hardware (repro + crash dumps + symbolized stacks), fix to follow on a new branch.

@Tryanks Tryanks closed this Aug 22, 2026
@Tryanks
Tryanks deleted the fix/149-windows-preview-containment branch August 22, 2026 14:00
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.

Windows: embedded preview WebView can crash the entire app

1 participant