Repository navigation
fix(browser): match loading surfaces to the Orca theme - #18738
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughBrowser webviews now use theme-aware backgrounds and opaque guest canvases. Blank documents remain hidden until a real main-frame document commits. Renderer loss hides the guest until recovery. Unit tests cover these states and webview preferences. New end-to-end coverage controls HTTP responses, captures visual and DOM state, verifies reload and worktree retention, tests renderer recovery, and validates navigation retry behavior. Merge Risk: 🔵 Low · up to This updates browser loading surfaces so hosts follow the application theme while committed webpages render opaquely. The light-theme webpage check can still pass without a visible guest, so the change is mergeable with a bounded test-coverage follow-up. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 497b1bac-a843-4fe6-9d79-7d2ffe6f9d87
📒 Files selected for processing (10)
docs/assets/browser-themed-loading/README.mddocs/assets/browser-themed-loading/baseline-observations.jsondocs/assets/browser-themed-loading/candidate-observations.jsondocs/assets/browser-themed-loading/matrix.jsondocs/assets/browser-themed-loading/reverted-observations.jsonsrc/renderer/src/components/browser-pane/host-guest/browser-page-webview-surface.test.tssrc/renderer/src/components/browser-pane/host-guest/browser-page-webview.tssrc/renderer/src/components/browser-pane/stream-remote/remote-browser-page-viewport.test.tsxtests/e2e/browser-loading-surface-oracle.tstests/e2e/browser-loading-surface.spec.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.
| ? state.background === state.theme || | ||
| state.visibility === 'hidden' || | ||
| state.display === 'none' | ||
| : state.url.startsWith('http://127.0.0.1:') |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Require the white-page guest to remain rendered. When expected === 'white', also require state.attached, state.visibility === 'visible', and state.display !== 'none'. Otherwise a hidden webview can expose the white host surface while retaining the loopback URL and pass the oracle.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| : state.url.startsWith('http://127.0.0.1:') | |
| : state.url.startsWith('http://127.0.0.1:') && | |
| state.attached && | |
| state.visibility === 'visible' && | |
| state.display !== 'none' |
There was a problem hiding this comment.
Important
One cross-platform concern to resolve before merge — the blank/crash suppression hinges on visibility: hidden, which is validated only on macOS (see the inline comment on browser-page-webview.ts).
Reviewed changes
- Themed guest surface —
ensureBrowserPageWebviewreplaces the hard-coded#ffffffhost background withvar(--background)and appendstransparent=falseto the shared webpreferences so unstyled pages keep a readable white canvas instead of inheriting Orca's dark theme. - Blank/recovery suppression — guest-owned
load-commitandrender-process-gonelisteners hide the guest for synthetic blank documents (about:blank/data:text/html,) and reveal it once a non-blank main frame commits, preserving the themed New Tab and recovery surfaces. - Focused coverage — a happy-dom unit suite for surface ownership/reuse/remount, a remote-viewport regression test, and a deterministic Playwright oracle that gates/holds responses and samples raster pixels across 19 phases (11/19 on main and reverted, 19/19 on candidate).
ℹ️ Nitpicks
- The three
*-observations.jsonfiles underdocs/assets/browser-themed-loading/(~1500 lines) are one-shot evidence that no tooling reads; consider keeping the README plusmatrix.jsonand dropping the raw dumps so future diffs aren't polluted.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
| // A committed synthetic blank document belongs to New Tab, including while its first URL waits. | ||
| guest.addEventListener('load-commit', (event) => { | ||
| if (event.isMainFrame) { | ||
| guest.style.visibility = |
There was a problem hiding this comment.
The blank/crash suppression depends on visibility: hidden suppressing the guest's composited frame, but browser-page-pane.tsx:324 sets display: none on this same guest specifically because "some Electron builds keep painting a hidden guest layer". Validation was macOS-only; please confirm visibility: hidden actually hides the white canvas on Linux/Windows before merge.
Technical details
# Verify `visibility: hidden` suppresses guest compositing cross-platform
## Affected sites
- `src/renderer/src/components/browser-pane/host-guest/browser-page-webview.ts:79` (and `:84`) — the new blank/crash hiding mechanism.
- `src/renderer/src/components/browser-pane/assemble-chrome/browser-page-pane.tsx:324-325` — pre-existing code that uses `display: none` for the failure overlay on this same guest, with the comment "some Electron builds keep painting a hidden guest layer, so drop it from layout (display:none) instead of just hiding it".
## Required outcome
- Demonstrate that a `visibility: hidden` `<webview>` stops painting its (now opaque-white) canvas on Linux and Windows too, or switch the blank/crash states to a mechanism that provably suppresses compositing without blanking the in-flight navigation (note `attach-browser-page-webview.ts:124` warns that navigating a `display: none` guest can leave it blank).
## Suggested approach (optional)
- Run the `browser-loading-surface` oracle on the Linux/Windows CI runners before merge; the author's checklist already flags full CI as unrun.There was a problem hiding this comment.
Important
The test-only delta is clean, but the previously raised cross-platform concern is still open and blocks merge.
Reviewed changes
- Synced the
webpreferencesassertion —BrowserPane.webview-preferences.test.tsnow expects thetransparent=falsesuffix the factory appends, keeping the pre-existing suite green against the prod change. - Froze the renderer clock during the attach gate — the e2e oracle now pauses the page clock (
page.clock.pauseAt) so the missing-guest watchdog does not fire whilesrcis held for the pre-attach screenshot, resuming on release and in thefinallyblock.
The blank/crash suppression still hinges on visibility: hidden on browser-page-webview.ts:79, validated only on macOS; the production file is byte-identical since that thread was raised, so it must still be confirmed on Linux/Windows before merging.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Important
The test-only delta is clean, but the cross-platform concern raised in the initial review is still open and blocks merge.
Reviewed changes
- Await painted content after network recovery — the e2e oracle now retries raster sampling for
whitephases viaexpect.pollafterisLoading()settles, because loading can stop before the compositor presents the recovered guest's first frame, instead of failing on a single pre-paint sample.
The production file browser-page-webview.ts is byte-identical since the first review, so the blank/crash suppression still hinges on visibility: hidden (browser-page-webview.ts:79), validated only on macOS. That thread remains open and must be confirmed on Linux/Windows before merging.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
* fix(browser): theme unavailable guest surfaces without recoloring pages * test(browser): keep generated loading evidence out of the PR diff * test(browser): freeze recovery clock during artificial attach gate * test(browser): await painted content after network recovery

ELI5
Opening a browser pane in dark mode could briefly show a bright white rectangle. The empty surface now matches Orca's theme, while real webpages keep their own colors.
What Changed
var(--background)for the local webview host and Electron'stransparent=falsepreference for the webpage canvas.Why
Main at
264c9ed8d27breproduces the failure. The guest factory hard-coded white before Electron painted. A CSS-only correction makes unstyled webpages inherit Orca's dark canvas; native guest opacity preserves their normal readable white canvas.The factory owns the affected surface across creation, parking, and recovery. Remote/client-hosted factories were traced and left unchanged; the remote viewport already uses the theme before a decoded frame.
Linked Issue
User-reported regression; no linked issue was supplied.
Visual Proof
Full-app screenshots from an isolated Orca dev instance, captured with Playwright CDP while the same controlled HTTP response was held.
Unstyled webpage stays white · New Tab · Recovery
Testing
The same oracle checks raster pixels and guest/host state across attachment, held/streamed first responses, live dark/light/system changes, unstyled content, reload, park/unpark, renderer crash recovery, New Tab, and network failure/retry:
Passed: all 799 browser-pane unit tests (99 files), seven Electron tests,
pnpm tc:web, changed-file oxlint, andpnpm run check:code-quality:changed.Reproduce with
pnpm run test:e2e -- tests/e2e/browser-loading-surface.spec.ts --workers=1. The artificial pre-attach gate pauses the renderer test clock so slower screenshot capture cannot trigger the missing-guest watchdog; normal time resumes when attachment is released. Painted-content captures wait for the compositor to present the page; held pre-content captures remain immediate. Screenshots and results are attached here; generated observation reports are kept outside the source diff.Limits: Windows, live paired-host, and SSH/folder scenarios were not separately rendered. Optional whole-suite
pnpm run typecheck:e2ereports unrelated suite diagnostics; neither added oracle file is named. The full lint/typecheck/test/build suite was not run.Review
Three independent reviewers checked architecture/simplicity, visual/theme/accessibility, and lifecycle/regression risk. Two rounds completed with no proven in-scope issues remaining. Validation findings added network retry/committed-empty coverage and corrected transient-UI sampling.
Agent skill upstream boundary
Notes
No protocol, execution-host, provider, path, shortcut, or permission changes. Cross-platform CI is recommended before merge.
Checklist
pnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass; targeted local checks above passed, broader CI remains