Skip to content

[bug] nightly: asset reference picker can stay closed when caret re-enters @ after Escape #394

Open

Description

@hsliuustc0106

Evidence

  • Nightly #12, browser-extended step 8, main 4360d9eb66b23598d3f637b2288745291e818862, scheduled attempt 1. Ubuntu 22.04, Node 24.22.1, Python 3.12.16, Playwright Core 1.58.2 / Chromium headless shell, isolated fixture.
  • reference_picker.mjs times out after 15 s waiting for the “引用项目资产” dialog. The logged editor is focused, text/HTML is 前@后, selection anchor/focus are both 2, and aria-expanded=false.

Reproduce

Run node tests/browser/reference_picker.mjs with the nightly dev/fixture setup. In the relevant scenario, start with the picker open at the @ in 前@后. Press Escape, move right to offset 3, then move left back to offset 2. The earlier initial open passed; this is the reopen after dismiss. Observed in CI; no independent replay.

Expected / actual

Moving outside the mention and back should reopen the project-asset picker; Escape should still suppress it when the caret stays on the same mention. In the failing run it stayed closed at offset 2.

Diagnosis / acceptance

Product event timing versus test synchronization is not yet established. Editor dismissal logic retains the dismissed mention; the selection-change path can clear it when it processes an outside caret. A rapid 2 → 3 → 2 transition might not be observed at offset 3. The test's hidden check is already satisfied after Escape and does not prove the handler saw that transition. Record the actual selection-change order and compare rapid and event-synchronized sequences on the same fixture; cover both Escape-without-motion and leave/re-enter. Do not treat an increased timeout alone as a root-cause fix.

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

    area:assetsAssets, library and reference inputs

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions