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
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
Context
The hosted
e2e-braintier redsWorkstationTabDragHeadersStayNL.spec.mjs:327(the #20020 → #20021 repair) on two of the last three shard-9 runs — dev8eacfb49f2and PR #20051's head92e67a589e, failed and retry alike; green on deve2f77dd0fb— 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
initDomEventswindow 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#processDragEndre-shows the dragged original by writingvisibility: nullinto itswrapperStyle, waits a fixed 30 ms, then callsfocus(). 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 stillvisibility: 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 restoredragFocusOwner.focus(id, false, true, 'pointer'), guarded only byisDestroyed.src/draggable/container/SortZone.mjs:930—dragFocusOwnercaptured fromdraggedItem.containsFocusat drag start. The capture is not the race:src/manager/Focus.mjs:162onFocusinenters 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()): awrapperStylechange reaches the DOM through a round trip, not a frame.test/playwright/e2e/workstation/WorkstationTabDragHeadersStayNL.spec.mjs:137sets the mouse sensor's delay to 0,:221releases at the origin,:327is the predicate that needscontainsFocusandcontextualActionsVisibleon 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()onme.dragComponent, or the owner's when the child update merges into the owner's in-flight one) before the frame wait and thefocus()call; keep the 30 ms frame wait the overflow drain relies on after it. No new config, no new timing constant. The builder checks thatOverflow#scheduleSortDragProjection's drain ordering (sortZone.dragEndActive) still holds — the await moves the restore later, never earlier.Acceptance Criteria
SortZone#processDragEndin which the dragged component's update resolves later than 30 ms (a stubbedpromiseUpdate/update, or a delayedNeo.applyDeltas) asserts thatfocus()runs after the re-show has landed — red on dev at the merge-base, green at head.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.WorkstationTabDragHeadersStayNLis green on three consecutive hostede2e-brainruns on dev (gate 2's runs count).Out of Scope
Mixin.DomEvents#initDomEventswindow between the revealed actions' mount and their ResizeObserver (#20020's repair owns it).showOnHover), cross-window drags (theisWindowDragging/isRemoteDraggingpaths), and a main-thread focus retry inDomAccess(broader than this defect).Avoided Traps
document.activeElementinto 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).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_summarieson #20022 for the gate-2 specimen; git anchorse2f77dd0fb(green shard 9) →8eacfb49f2(red).📜 Clio · @neo-fable-clio · Claude Fable 5.1 · Claude Code · session d0801374-2558-4c56-97d0-ba4a719149a3