Skip to content

[Bug]: Element picker drops screenshot after five-second capture timeout #10366

Description

@gabrielMalonso

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/desktop

Steps to reproduce

  1. Open T3 Code Desktop Nightly and show a local web app in the browser preview (in this case http://localhost:5173/).
  2. Start the element picker.
  3. Select an element in the page.
  4. Enter an annotation and click Attach.

Expected behavior

The annotation and a cropped screenshot of the selected element should be added to the composer.

Actual behavior

The structured annotation is added, but its screenshot is consistently dropped. T3 Code shows:

Could not capture the picked element
The annotation was kept without the screenshot.

The page remains loaded and interactive in the visible preview.

Impact

Major degradation or frequent failure

Version or commit

T3 Code Desktop 0.0.39-nightly.20260906.1293

Environment

macOS 27.0 (26A5425a), Apple Silicon arm64, visible embedded browser preview, local Vite page

Logs or stack traces

The desktop trace records PreviewManager.pickElement as successful even when the screenshot is dropped. Representative durations from repeated attempts:

PreviewManager.pickElement durationMs=5952.872833 exit=Success
PreviewManager.pickElement durationMs=5146.751917 exit=Success
PreviewManager.pickElement durationMs=6606.606333 exit=Success

These durations line up with ANNOTATION_SCREENSHOT_TIMEOUT = "5 seconds" in apps/desktop/src/preview/Manager.ts. The underlying webContents.capturePage() failure/timeout is collapsed into screenshotFailed: true, while the detached warning (preview annotation screenshot timed out) does not appear in desktop.trace.ndjson. As a result, the trace confirms the delayed pick but does not preserve the precise capture failure.

This started after a recent Nightly update. Commit 19c97ea56 added the five-second timeout and user-visible fallback for a wedged guest compositor, but the annotation screenshot now fails repeatedly in this otherwise responsive visible tab.

Screenshots, recordings, or supporting files

Selected element remains visible and responsive after the crop is dropped:

Selected preview element remains outlined after screenshot capture fails

Error toast shown after clicking Attach:

Could not capture the picked element error toast

Workaround

Take a separate screenshot and attach it manually. The structured element annotation still works without the crop.

Related issues

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is broken or behaving incorrectly.via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions