Skip to content

feat(browser): preserve page appearance while native views are occluded - #2977

Merged
wsp1911 merged 2 commits into
GCWing:mainfrom
wsp1911:browser
Sep 11, 2026
Merged

feat(browser): preserve page appearance while native views are occluded#2977
wsp1911 merged 2 commits into
GCWing:mainfrom
wsp1911:browser

Conversation

@wsp1911

@wsp1911 wsp1911 commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Show a cached, decoded page snapshot beneath floating surfaces when the native browser is hidden.
  • Align native views and snapshots to the same physical-pixel rectangle, preventing rounded corners and subtle shifts during transitions.
  • Bound screenshot size, invalidate stale frames, and retain the existing placeholder when capture is unavailable.

Type and Areas

Type: Feature / bug fix / UI/UX

Areas: Desktop/Tauri, Web UI, remote surface contracts, docs

Motivation / Impact

Opening a tooltip, context menu, or session overview over the embedded browser previously exposed a generic placeholder. Cached snapshots preserve the page appearance while allowing floating surfaces to remain visible.

Snapshots now use square corners and matching native-view geometry, avoiding visible movement at fractional display scaling.

Verification

  • Passed: pnpm run check:web.
  • Passed: pnpm --dir src/web-ui exec vitest run src/app/scenes/browser/browserPreviewCache.test.ts src/app/scenes/browser/nativeWebviewVisibility.test.ts src/app/scenes/browser/useEmbeddedBrowserWebview.test.tsx — 18 tests.
  • Passed after removing diagnostic probes: pnpm --dir src/web-ui exec tsc --noEmit and git diff --check.
  • Manual Windows desktop validation at 150% scaling: the user confirmed the fix after reproducing transitions through a FlowChat file-link tooltip, browser-tab context menu, and session overview.
  • Rust tests and macOS/Linux runtime checks were not run in this verification pass. Real remote scenarios were not exercised.

Reviewer Notes

  • Capture runs only while the native view and document are visible; hiding never waits for capture.
  • Frames remain in memory, with the longest edge limited to 1600 pixels.
  • Preview capture stays controller-local in Peer Device Mode. The web iframe path is unchanged.
  • Unsupported or older hosts retain the existing placeholder.
  • Temporary diagnostic probes were removed after user confirmation.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

- Centralize visibility and focus decisions across navigation, resizing,
  tab activation, and toolbar transitions
- Mark shared overlays and session overview menus as native occluders
- Track overlay visibility and geometry changes, including delayed bounds
- Serialize native visibility calls and recheck state after async work
- Add regression tests for overlapping panels and visibility races
- Preserve page appearance beneath menus and panels with decoded previews.
- Bound screenshot size and sample only while native views are visible.
- Invalidate stale frames and fall back when capture is unavailable.
- Keep preview capture local to the controller in Peer Device Mode.
@wsp1911
wsp1911 merged commit 39c6085 into GCWing:main Sep 11, 2026
3 checks passed
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.

1 participant