Skip to content

Load review UI from file instead of inline HTML - #3

Open
pokoli wants to merge 1 commit into
earendil-works:mainfrom
pokoli:fix/linux-chromium-blank-review-window
Open

Load review UI from file instead of inline HTML#3
pokoli wants to merge 1 commit into
earendil-works:mainfrom
pokoli:fix/linux-chromium-blank-review-window

Conversation

@pokoli

@pokoli pokoli commented Jul 23, 2026

Copy link
Copy Markdown

This changes Review Loop to load its web UI from the built
web/dist/index.html file instead of passing the full HTML inline to
open().

Why:

  • On Linux, when glimpseui falls back to its Chromium backend, opening the
    large self-contained Review Loop HTML inline can result in a blank window.
  • Loading the built file from disk avoids that problem and worked correctly in
    local testing.

What changed:

  • Added a helper to resolve the built review HTML file path.
  • Open the window first, then load the UI with window.loadFile(...) on
    ready.

This is a small change that should make the extension more robust on Linux
setups using the Chromium fallback backend.

Comment thread src/controller.ts
@pokoli
pokoli force-pushed the fix/linux-chromium-blank-review-window branch from 1819c58 to 7e6548b Compare July 23, 2026 12:10
@zegging

zegging commented Jul 24, 2026

Copy link
Copy Markdown

Just hit what looks like the same underlying issue on Windows — the inline-HTML path also breaks the WebView2 backend, not just the Linux/Chromium fallback.

WebView2's CoreWebView2.NavigateToString has a hard ~2 MB limit on the HTML string (documented on ICoreWebView2::NavigateToString), and the self-contained Review Loop UI (bundles Monaco) blows past it. Result on Windows is an immediate ArgumentException from the native Glimpse host:

System.ArgumentException: Value does not fall within the expected range.
   at Microsoft.Web.WebView2.Core.Raw.ICoreWebView2.NavigateToString(String htmlContent)
   at Microsoft.Web.WebView2.Core.CoreWebView2.NavigateToString(String htmlContent)
   at GlimpseHost.HandleCommand(JsonElement json) in .../glimpseui/native/windows/Program.cs:line 233
   at GlimpseHost.HandleCommand(String payload) in .../glimpseui/native/windows/Program.cs:line 220
   at GlimpseHost.<>c__DisplayClass31_0.<ReadCommandsAsync>b__1() in .../glimpseui/native/windows/Program.cs:line 184
   at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(...)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunInternal(...)
   at System.Windows.Forms.Control.InvokeMarshaledCallbacks()

Environment: Windows, .NET SDK 8.0.423, WebView2 Microsoft.Web.WebView2.Core 1.0.2957.106, glimpseui 0.8.1, pi-review-loop 0.3.0.

Since this PR switches to loadFile(...) on the built web/dist/index.html, it should fix the Windows crash as a side effect (the offending NavigateToString call in the Glimpse Windows host stops being reached at all). Would be great to get it merged — happy to test the merged version on Windows if useful.

@zegging

zegging commented Jul 24, 2026

Copy link
Copy Markdown

Tested this branch on Windows against the same setup from my previous comment (Win + .NET SDK 8.0.423 + WebView2 1.0.2957.106 + glimpseui 0.8.1). /diff-review now opens the Review Loop UI cleanly — no more NavigateToString ArgumentException, Monaco diff renders and the file list interactions work. LGTM from a Windows-smoke-test perspective.

Alexander01998 added a commit to Alexander01998/pi-review-loop that referenced this pull request Jul 27, 2026
This is basically PR earendil-works#3 and issue earendil-works#1 upstream.
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.

3 participants