Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(preview): failed tabs no longer sit as a blank floating panel #7236

Closedgb1095(GitHub profile, opens in a new tab)wants to merge 17 commits intomain fromrefs/pull/7236/headopened View on GitHub

A dead preview URL still counted as a live tab. The floating mini-player stayed a white rectangle, and preview_status told the agent the page was healthy.

The mini-player now shows Retry and Close on a failed load. Status reports available: false with the URL the agent actually tried, not chrome-error://.

Closes #7212.

Verification:

  • 82 desktop preview-manager tests
  • 14 focused web preview tests
  • 2 IPC contract tests
  • web, desktop, and contracts typechecks
  • targeted lint, formatting, and git diff --check

Originally implemented with Grok 4.6 through Grok CLI. Rebased and updated with GPT-5.6 Luna in Codex.


Note

Medium Risk Changes preview automation readiness and status semantics across desktop IPC and the web host, which can affect agent navigate/retry behavior but stays within preview UI and automation—not auth or data paths.

Overview Failed preview navigations no longer look like a healthy, blank mini-player or automation target. LoadFailed tabs show a Retry/Close overlay instead of an empty webview, and agents get available: false with the requested URL and error text—not chrome-error://.

Desktop PreviewManager.automationStatus now exposes an optional attached flag (live guest vs stale overlay), treats LoadFailed as unavailable while keeping the guest reachable for retry, and preserves failure metadata when web contents are destroyed. Web-side applyPreviewLoadFailureToAutomationStatus merges snapshot failures into preview_status without letting stale LoadFailed state override a live healthy or loading guest.

waitForNavigationReadiness and overlay waiting stop treating available: false as an infinite wait: attached failed loads settle, detached/destroyed guests fail fast. Picture-in-picture is blocked on unreachable previews unless PiP is already open.

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

Note

Fix failed preview tabs showing blank floating panel with unreachable overlay

  • Adds PreviewMiniPlayerUnreachable overlay that displays a parsed host, friendly error description, and Retry/Close actions when a preview navigation fails
  • Adds an optional attached boolean to DesktopPreviewAutomationStatusSchema so the main process reports whether the guest webContents is still alive, distinguishing live guests from destroyed or missing ones
  • Updates previewNavigationReadiness and preview.waitForDesktopOverlay to resolve readiness after a failed load when the guest is attached, and to reject with target-unavailable when the guest is detached or destroyed
  • Transforms snapshot-only LoadFailed states into unavailable automation status, preserving the requested navigation URL and failure title instead of a chrome-error interstitial URL
  • Behavioral Change: PreviewManager.automationStatus no longer replaces failed navigation details with chrome-error URLs or in-flight loading state; callers that do not pass live-status precedence will now see unavailable with the original requested URL. ThreadPreviewMiniPlayer disables popping out a failed preview unless already popped out.
Macroscope summarized 9ef66d5.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Team

      Run ID: 895e3cbd-6d8b-463d-8bdd-9959f0ad3c29

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review

      Warning

      Your free Security trial is over. An organization admin can upgrade to Advanced for continuous pull request security review or dismiss this notice.


      Comment `@coderabbitai help` to get the list of available commands.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    3. One finding: the new mini-player overlay's buttons inherit pointer-events: none from the mini-player root, so Retry/Close can't be clicked.

      Posted via Macroscope — UI Consistency
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      preview/PreviewMiniPlayerUnreachable.tsx:18

      The mini-player root <section> in ThreadPreviewMiniPlayer is pointer-events-none, and pointer-events is inherited, so this overlay and the Buttons inside it are not hit targets (Button only sets disabled:pointer-events-none, never pointer-events-auto). Retry and Close would render but never fire, and clicks would fall through to the surface below — the sibling layers in that file each opt in explicitly (pointer-events-auto on the drag toolbar and resize handle, pointer-events-none on the non-interactive reconnecting placeholder). Suggest opting this interactive overlay back in:

          <div className="pointer-events-auto absolute inset-0 z-[32] flex flex-col items-center justify-center gap-3 rounded-xl bg-background px-4 text-center">

      No longer relevant as of fb46b3a2614013241cbc05103df707d94f943c98

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

      Approvability

      Verdict: Not approved

      Macroscope's review found this PR not approvable — This fixes failed floating previews with a new Retry/Close UI and coordinated desktop, web, automation-readiness, and IPC-status changes. Because it alters an automatic automation gate and adds cross-process production behavior beyond a small isolated fix, human review is warranted.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    5. Rebased onto current main after #7082 / tooltip lint. Conflict was only in ThreadPreviewMiniPlayer.tsx; kept the styled tooltips and the failed-tab PiP disable (close stays available if already popped out).

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

      🟡 Medium preview/PreviewMiniPlayerUnreachable.tsx:35

      For valid hostless URLs such as file:///missing.html and data:..., the heading renders as Can't reach with no attempted URL. new URL(url).host returns an empty string, and safeHost(url) ?? url does not fall back for empty strings; return null when the host is empty.

      ✅ Resolved in c63e97347fdc9807f93624caab577e42fa1e923d

    7. One finding on the new mini-player unreachable overlay: the host line can overflow the floating player because nothing constrains or truncates it.

      Posted via Macroscope — UI Consistency
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      preview/PreviewMiniPlayerUnreachable.tsx:19

      The host line has no width constraint or truncation, and neither this overlay nor the mini-player body (relative h-full min-h-0 in ThreadPreviewMiniPlayer) clips overflow. The player can be as narrow as PREVIEW_MINI_PLAYER_MIN_SIZE.width (240px, ~208px after px-4), so a remote-environment host that offers no break opportunity (e.g. averylongsubdomain.internal.example.com:3000) renders outside the opaque overlay and over the chat behind it. Elsewhere host strings are constrained and truncated (PreviewLocalServerCard uses min-w-0 + truncate); consider doing the same here.

            <p className="max-w-full truncate text-xs font-medium text-foreground">Can&apos;t reach {host}</p>

      No longer relevant as of c63e97347fdc9807f93624caab577e42fa1e923d

    8. looking forward to this getting merged 👀

    9. Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.

      Fix All in Cursor ❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot). Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 7c268a7f245d5bbb032f8d734e88f25ef1798783. Configure [here](https://www.cursor.com/dashboard/bugbot).
    10. Note

      This comment is posted by Julius' dot

      Closing for missing UI verification. The PR adds a failed preview overlay with Retry and Close and changes the picture in picture controls, but supplies no screenshots or recording of the changed UI. The screenshot in #7212 shows only the original blank panel. Attach before/after screenshots and a short recording of a failed load, Retry, and Close, including an already open picture in picture window, then request reconsideration.

    11. juliusmarminge closed this

Sign in to join this conversation.