Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): keep agent browser preview visible #9484

Mergedmaria-rcksmerged 2 commits intomain fromrefs/pull/9484/headmerged by maria-rcks View on GitHub

maria-rckscommented

Agent-driven browser operations only surfaced the floating preview when creating a tab, and docking that tab permanently discarded the display intent. This keeps the intent across reused operations and right-panel transitions, while respecting explicit hide requests and the user's auto-show preference. Verified with 135 focused tests, web and contracts typechecks, focused lint and formatting, and a production web build. Built with gpt-5.6-sol in T3 Code through the Codex harness.


Note

Medium Risk Changes Electron webview layering and preview automation presentation rules (auto-show/suppression), which affects visible UI and agent workflows but not auth or data handling.

Overview Fixes agent browser preview visibility when the same tab is docked in the right panel or reused by later automation calls, with correct stacking against the compact right-panel sheet.

Floating preview vs right panel: The mini-player store is no longer closed when the matching preview is shown in the right panel; shouldRenderPreviewMiniPlayer hides the floating UI instead so intent survives panel transitions. The right-panel sheet can render under an overlapping mini-player via underFloatingPreview and a dedicated z-[35] layer on backdrop/viewport.

Stacking: Browser surface presentation now carries zIndex (default 30) from BrowserSurfaceSlot through the surface store into hosted webview wrapper styles; the mini player uses PREVIEW_MINI_PLAYER_WEBVIEW_Z_INDEX (48) with adjusted chrome layers.

Automation: Non-open operations can auto-open the floating preview when browserAutoShowFloatingPreview is on, unless the tab was explicitly suppressed by a prior open/show: false. Suppression is tracked per thread/runtime tab in PreviewAutomationHosts. Settings/contracts copy now describes auto-show when an agent uses a browser, not only on open.

Note: BrowserSurfacePresentation now requires zIndex on in-tree consumers.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 533421dd46c1e9da3da6fbf23abe98d8db0eb2ce. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Keep agent browser preview visible across right panel and automation use

  • Adds z-index to BrowserSurfacePresentation so hosted webviews use the surface's requested layer instead of a fixed default, and BrowserSurfaceSlot publishes z-index on lease and layer change
  • Reworks mini-player visibility in ChatViewContent: shouldRenderPreviewMiniPlayer hides the floating preview only when the same tab renders in the right panel, preserving the mini-player store entry so it reappears when the panel changes
  • Adds shouldAutoShowPreviewForAutomationUse and explicitlySuppressesPreviewMiniPlayer so non-open automation operations auto-show the mini-player for an existing tab when the preference is enabled, while explicit background requests suppress and close it
  • Splits ThreadPreviewMiniPlayer into shell, webview, and control layers, and adds a lower layer class for RightPanelSheet when it overlaps a floating preview
  • Updates the auto-show setting description and documentation to cover agent reuse of an existing preview
  • Risk: browserSurfaceStore.present now includes z-index in the no-op comparison; callers that previously relied on a no-op presentation when only the layer changed will now trigger a state update
Macroscope summarized 533421d.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Not approved

      Macroscope's review found this PR not approvable — The PR changes default-enabled automation behavior so browser operations beyond opening a tab can surface a floating preview, while coordinating stacking across the hosted webview, mini-player, and right-panel sheet. Its stateful suppression logic and changes to shared browser and Sheet infrastructure make the runtime impact broader than a small isolated UI fix.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. maria-rcks merged this12e8997

    4. maria-rcks closed this

Sign in to join this conversation.