LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-grace
createdAtOct 23, 2026, 3:40 PM
updatedAtOct 23, 2026, 4:38 PM
githubUrlhttps://github.com/neomjs/neo/issues/20057
authorneo-fable-clio
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtOct 23, 2026, 4:38 PM
milestonev13.3.1

Drag-end focus restore fires before the dragged item is visible again

Closed v13.3.1/archive-v13-3-1-chunk-1 bugaicoreaccessibilitydashboard
neo-fable-clio
neo-fable-clio commented on Oct 23, 2026, 3:40 PM

Context

The hosted e2e-brain tier reds WorkstationTabDragHeadersStayNL.spec.mjs:327 (the #20020 → #20021 repair) on two of the last three shard-9 runs — dev 8eacfb49f2 and PR #20051's head 92e67a589e, failed and retry alike; green on dev e2f77dd0fb — with the end state the cut steward read from the retained trace (#20022, comment 6365360273): after the drop the strip holds the unfocused partition for the whole 10 s, no focus-gated rail, Undo disabled, no console or page error. Locally the spec is green. The steward's cut handover left the diagnosis lane open and unowned; this ticket is the diagnosis by code read, the reproduction is AC-1/AC-2.

Live latest-open sweep: checked the latest 20 open issues at 2026-10-23 13:3xZ (#20056 … #19147); no equivalent. A2A claim sweep (last 30 messages, all read states): no claim. Memory Core rationale sweep: the #20020 diagnosis treats the restore as always landing — the 150 ms initDomEvents window it found sits downstream of a restore that happened.

The Problem

After a pointer drag of a tab the engine hands focus back to the dragged button (#19281): hiding the original at drag start moves the browser's focus to the body, and the terminal is meant to give it back. SortZone#processDragEnd re-shows the dragged original by writing visibility: null into its wrapperStyle, waits a fixed 30 ms, then calls focus(). The re-show is an ordinary vdom update — asynchronous across the worker boundary and not awaited. When the App worker → main round trip takes longer than 30 ms (the hosted tier under ten shards; a seat under load) focus() reaches an element that is still visibility: hidden. A hidden element is not focusable, so the call is a no-op and nothing retries: focus stays on the body, the strip never regains it, the rail never reveals, the partition stays the unfocused one — the trace's end state. A person under the same load loses keyboard focus to the body after every tab drag.

The Architectural Reality

  • src/draggable/container/SortZone.mjs:643-647 — the re-show (style.visibility = null; me.dragComponent.wrapperStyle = style), unawaited.
  • src/draggable/container/SortZone.mjs:689 — await me.timeout(30); :691-694 — the restore dragFocusOwner.focus(id, false, true, 'pointer'), guarded only by isDestroyed.
  • src/draggable/container/SortZone.mjs:930 — dragFocusOwner captured from draggedItem.containsFocus at drag start. The capture is not the race: src/manager/Focus.mjs:162 onFocusin enters focus synchronously on the focusin message, which precedes the drag-start message in DOM order.
  • src/component/Base.mjs:1082 (afterSetWrapperStyle) → :2026 (updateStyle) → :2038 (update()): a wrapperStyle change reaches the DOM through a round trip, not a frame.
  • The spec: test/playwright/e2e/workstation/WorkstationTabDragHeadersStayNL.spec.mjs:137 sets the mouse sensor's delay to 0, :221 releases at the origin, :327 is the predicate that needs containsFocus and contextualActionsVisible on the header before the partition can settle.

The Fix

Make the restore wait for the re-show instead of for a clock: in processDragEnd, await the dragged component's update (promiseUpdate() on me.dragComponent, or the owner's when the child update merges into the owner's in-flight one) before the frame wait and the focus() call; keep the 30 ms frame wait the overflow drain relies on after it. No new config, no new timing constant. The builder checks that Overflow#scheduleSortDragProjection's drain ordering (sortZone.dragEndActive) still holds — the await moves the restore later, never earlier.

Acceptance Criteria

  • AC-1 (red-first, deterministic): a unit arm on SortZone#processDragEnd in which the dragged component's update resolves later than 30 ms (a stubbed promiseUpdate/update, or a delayed Neo.applyDeltas) asserts that focus() runs after the re-show has landed — red on dev at the merge-base, green at head.
  • AC-2 (red-first, the specimen): WorkstationTabDragHeadersStayNL.spec.mjs's gesture with the page's main thread throttled through CDP (Emulation.setCPUThrottlingRate, the rate calibrated on the seat until the base reproduces the trace's end state) is red at the merge-base and green at head; the throttle lives in that arm, never in the spec's default run.
  • AC-3 (post-merge): the shard carrying WorkstationTabDragHeadersStayNL is green on three consecutive hosted e2e-brain runs on dev (gate 2's runs count).

Out of Scope

  • The 150 ms Mixin.DomEvents#initDomEvents window between the revealed actions' mount and their ResizeObserver (#20020's repair owns it).
  • Hover-mode reveals (showOnHover), cross-window drags (the isWindowDragging / isRemoteDragging paths), and a main-thread focus retry in DomAccess (broader than this defect).
  • The spec's oracle (#20020 / #20021): it is right to demand the focused-extent partition and must not be loosened to pass.

Avoided Traps

  • Raising the 30 ms wait: another clock, the same race one notch further out.
  • Having the spec focus the strip after the drop, or polling document.activeElement into place: test setup hiding a product defect (the gate-3 walk's lesson behind #20046 — specs that focus the pane as setup never see the unfocused path).
  • Reading the hosted red as an oracle defect: the end state is a product state a user reaches under load.

Related

#19281 (introduced the restore) · #20020 / #20021 (the spec's oracle repair; its diagnosis assumed the restore lands) · #20022 (cut record: the steward's specimen comments 6365360273 and 6365961226, the open diagnosis lane) · #20051 (the run whose trace was retained) · #20046 (the adjacent focus-gated partition fix) · #19988 (the drag's earlier header-flight defect)

handoff: unowned — a builder seat claims it on AGENT:*; the cut steward decides the milestone under the operator's known-bug ruling (a product timing defect that shows under load, not a test defect).

Origin Session ID: d0801374-2558-4c56-97d0-ba4a719149a3

Handoff Retrieval Hints: query_raw_memories("SortZone processDragEnd focus restore visibility hidden 30 ms hosted shard red"); query_summaries on #20022 for the gate-2 specimen; git anchors e2f77dd0fb (green shard 9) → 8eacfb49f2 (red).

📜 Clio · @neo-fable-clio · Claude Fable 5.1 · Claude Code · session d0801374-2558-4c56-97d0-ba4a719149a3

tobiu referenced in commit f034df3 - "fix(draggable): the drag-end focus restore waits for the dragged item's re-show to render (#20057) (#20063) on Oct 23, 2026, 4:38 PM
tobiu closed this issue on Oct 23, 2026, 4:38 PM