Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pause embedded browser previews and child WebView rendering when the native controller window is minimized or hidden, and resume eligible views when the window is restored.
Use one shared, event-driven infrastructure subscription to native window state across cached browser panels. Preserve active-panel, toolbar-transition and overlay-occlusion checks. The existing 5-second active preview interval and adaptive idle backoff up to 30 seconds are unchanged; no polling timer is added.
Type and Areas
Type: Bug fix
Areas: Web UI, desktop/Tauri window integration, browser visibility tests and verification guidance
Motivation / Impact
On Windows, the main WebView can keep
document.visibilityState === 'visible'while the native window reportsisMinimized() === true. The previous DOM-only check therefore kept taking screenshots and rendering an animated child page after minimization. Before the fix, a verified 30-second minimized sample recorded 5 captures and 5 decodes, with the test animation continuing at approximately 165 callbacks per second.The fix hides the native child view and stops scheduling preview captures while minimized. Restoring the window resumes only the active, unoccluded browser panel and does not explicitly request focus. Native window state always comes from the local controller, including Peer Device Mode.
Verification
Real Windows WebView2 verification
Used the actual Debug desktop host with WebView2
155.0.4283.45, Vite serving the changed source, and a local synthetic animated canvas. A temporary test host mounted the production browser hook, preview cache and preview component. Capture requests used the production native screenshot/encoding path; the native capture API was not mocked.Each phase was sampled for 30 seconds:
visible, but the child document reported hidden and its frame counter did not advance.Automated checks
The initial CI run had one failing test out of 11,460: an obsolete overview icon source assertion. The branch now includes upstream commit
41b06f9a3(test(web-ui): follow current overview icon composition); the failing test and overview component tests pass in the focused command above. Browser visibility implementation and preview intervals are unchanged by this upstream synchronization. The native WebView measurements above were collected before that synchronization, with identical browser runtime source files.pnpm --dir src/web-ui run test:run src/app/components/NavPanel/navigationIconIntegration.test.ts src/app/scenes/personal-overview/OverviewMiniAppLogos.test.tsx src/app/scenes/browser src/infrastructure/runtime/windowVisibility.test.ts— 51 tests passed across 11 files on the updated upstream baseline. Covers minimize/restore scheduling, inactive/occluded panels, initial minimized state, shared listeners, stale asynchronous snapshots, cleanup and web fallback.pnpm --dir src/web-ui exec tsc --noEmit— passed.pnpm --dir src/web-ui exec eslint src/infrastructure/runtime/windowVisibility.ts src/app/scenes/browser/useEmbeddedBrowserWebview.ts— passed.git diff --checkand staged whitespace check — passed.pnpm run check:web— blocked by 25 pre-existing typography violations in design-system Design Lab styles and MobileAvatar/MobileTag styles; those files are unchanged. Standalone TypeScript validation passed as listed above.Reviewer Notes
Checklist