t3code icon indicating copy to clipboard operation
t3code copied to clipboard

Clicking annotation Attach dismisses page dialogs and drops the screenshot

Open Mput13 opened this issue 4 weeks ago • 1 comments

What happened

Clicking Attach in the desktop browser's annotation editor also reaches the inspected page's outside-pointer handler. An open details panel closes before its selected element can be captured. The annotation reaches the composer, but its details show Screenshot unavailable.

Reproduced on the latest published Nightly, using only a synthetic HTML page and the real T3 Annotate/Attach controls. No project or personal data is included.

The recording below removes idle waiting and holds the final frame; the click itself runs at normal speed.

https://github.com/user-attachments/assets/e6f8738f-6838-4c07-8799-ca6413bf439a

Diagnosis

The page's document capture listener receives a trusted pointerdown whose retargeted element matches [data-t3code-annotation-ui], outside the details panel. It dismisses the panel before the Attach click handler submits the capture.

The shipped release source is consistent with this event leak:

The synthetic panel is an ordinary DOM section, not a native modal dialog. Runtime evidence establishes DOM event propagation; the exact fix has not been tested.

Steps to reproduce

  1. Extract the attached repro archive and run python3 -m http.server 18864 --bind 127.0.0.1 --directory fixture.
  2. Open http://127.0.0.1:18864 in T3 Code Desktop's integrated browser.
  3. Leave Dismiss on at pointerdown, then click Open details.
  4. Activate the real Annotate control in T3's browser toolbar.
  5. Select Select this detail with T3 Annotate inside the details panel.
  6. Physically click the real T3 Attach button.
  7. The panel closes, the dismissal counter changes from 0 to 1, and the event log records an annotation-host pointerdown followed by dismiss:outside.
  8. Inspect the annotation chip in the composer: Screenshot unavailable.

Expected: the page remains unchanged and the selected detail's screenshot is attached. Actual: outside dismissal runs before capture; the screenshot is unavailable.

The archive includes the exact tested HTML, before/after screenshots, event ledger and commands. There is no mock Attach implementation or synthetic dispatchEvent(). The pointerdown variant was reproduced twice with OS pointer input. Optional mousedown/click variants were not exercised.

attach-repro.zip

Version

0.1.7-nightly.20261102.4093

Environment

macOS 26.3.1 (a), arm64; T3 Code Nightly desktop; Electron 44.10.0 / Chromium 152.0.7977.169; local synthetic HTML, no dependencies

Evidence

Clean recorded run, page document capture listener:
{"sequence":9,"type":"pointerup","target":"target","trusted":true,"annotation":false,"open":true}
{"sequence":10,"type":"pointerdown","target":"div","trusted":true,"annotation":true,"open":true}
{"sequence":11,"type":"dismiss:outside","target":"div","trusted":true,"annotation":true,"open":false}
{"sequence":15,"type":"click","target":"div","trusted":true,"annotation":true,"open":false}

annotation=true means event.target.closest('[data-t3code-annotation-ui]') matched.
Native composer attachment details: Screenshot unavailable; 1 element.
Running guest userAgent: T3CodeNightly/0.1.7-nightly.20261102.4093, Electron/44.10.0.
This was the latest Nightly published when tested (2026-11-02 22:17 UTC).

Related issues

#20364: related annotation input isolation issue, but keyboard capture rather than outside pointer dismissal. #16030: native

top-layer/inertness, while this repro uses an ordinary section. #10366: crop timeout on a still-visible page, while this repro closes the target before capture. No matching issue found for Attach causing outside-pointer dismissal.

Fix applied or workaround

No T3 code or settings changed. Take a separate screenshot before starting Annotate, then attach it manually. This is a suggested workaround; it was not validated as part of this reproduction.

Filed by

Codex / GPT-6.1-Sol in T3 Code; local investigation following the T3 triage playbook

Mput13 avatar Nov 02 '26 22:11 Mput13

The tool buttons in the same toolbar trigger this too, not only Attach.

  1. Open a page with a popup or dropdown that closes on an outside pointerdown.
  2. Start annotation and open the popup.
  3. Switch tool (Select, Region or Draw).

The popup closes as soon as the tool button is pressed. onPointerDown (PickPreload.ts:1481 on main @ ade473018d) returns early for annotation UI targets, so the page's own capture listener still sees a pointerdown on the shadow host. Any click on the toolbar has this effect, so the fix probably belongs at the toolbar level rather than in the Attach handler.

This makes it hard to annotate popups at all: I open the popup, pick the tool I want, and the thing I wanted to annotate is gone.

Seen on desktop 0.1.7, Linux.

niclom12 avatar Nov 08 '26 14:11 niclom12