Repository navigation
fix(browser): reduce occlusion scans and preview capture overhead - #3395
Merged
Merged
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
Type and Areas
Type: Bug fix / performance
Areas: Web UI, desktop embedded browser, docs and tests.
Motivation / Impact
Each cached browser tab previously observed document-wide mutations independently, so unrelated UI animations repeatedly triggered full-page scans and layout reads. Visible browser previews also continuously captured and decoded screenshots even when the page was unchanged.
This reduces unnecessary host-side DOM and image-processing work while preserving popup occlusion, native view restoration, and stale-frame invalidation after navigation or resizing.
Verification
Passed after rebasing: 93 tests across 8 focused test files.
pnpm --dir src/web-ui exec vitest run \ src/app/scenes/browser/browserPreviewCache.test.ts \ src/app/scenes/browser/nativeWebviewOcclusionObserver.test.ts \ src/app/scenes/browser/nativeWebviewVisibility.test.ts \ src/app/scenes/browser/useEmbeddedBrowserWebview.test.tsx \ src/app/scenes/browser/browserStreamPerformanceScript.test.ts \ src/app/scenes/browser/browserPanelVisibilityContract.test.ts \ src/app/scenes/browser/nativeWebviewOcclusionContract.test.ts \ src/infrastructure/api/adapters/peer-device-adapter.test.tsPassed after rebasing:
pnpm --dir src/web-ui exec tsc --noEmit git diff --check upstream/main...HEADpnpm run check:webwas run before rebasing and stopped at 25 existing typography violations in untouched design-lab and mobile component files. Subsequent gates did not run. Those files and the typography audit scripts are unchanged by the rebase.Local Edge comparison with four cached browser tabs and one visible tab:
Popup occlusion and restoration also passed in the harness.
Reviewer Notes
Checklist