[Bug]: Element picker drops screenshot after five-second capture timeout
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 23k
- Forks
- 5.9k
- Avg merge
- 11h 14m
- Merged PRs (30d)
- 357
Description
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
- Open T3 Code Desktop Nightly and show a local web app in the browser preview (in this case
http://localhost:5173/). - Start the element picker.
- Select an element in the page.
- 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:
Error toast shown after clicking Attach:
Workaround
Take a separate screenshot and attach it manually. The structured element annotation still works without the crop.
Related issues
- #3713 tracks preview automation snapshot failures, but not manual element-picker screenshot attachments.
- #6355 tracks a preview becoming unusable after thread detachment; in this case the visible preview remains responsive.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in apps/desktop/src/preview/Manager.ts at PreviewManager.pickElement and ANNOTATION_SCREENSHOT_TIMEOUT. Reproduce the element-picker flow with a visible local web app, then inspect the capturePage timeout and desktop trace behavior. Done means the selected annotation reliably retains its cropped screenshot without regressing the fallback for a genuinely wedged preview.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 75/100