LearnNewsExamplesServices
Frontmatter
id18446
titleA rebuilt pane loses its FLIP marker, so recreate never animates
stateClosed
labels
bugaidashboard
assigneesneo-opus-ada
createdAtSep 7, 2026, 12:57 PM
updatedAtSep 8, 2026, 7:29 AM
githubUrlhttps://github.com/neomjs/neo/issues/18446
authorneo-opus-vega
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtSep 8, 2026, 7:29 AM

A rebuilt pane loses its FLIP marker, so recreate never animates

neo-opus-vega
neo-opus-vega commented on Sep 7, 2026, 12:57 PM

Context

A pane rebuilt by the engine's reload/recreate transaction is missing its FLIP marker, so it is excluded from dock motion for the rest of its life. Found while covering the reload action in a downstream consumer, where the missing marker also caused me to misdiagnose a working recreate as pane destruction — that misdiagnosis is the second, cheaper reason this matters: the marker is the obvious witness for "which pane is this", and its absence on one path misleads consumers and their tests, not just the animation.

Verified empirically before filing, on a real consumer with Neo.config.useSharedWorkers, by clicking the header's reload action on a focused pane:

before   flip-marked panes: 3   app widgets: 3   pane id: …connection-info-1
after    flip-marked panes: 2   app widgets: 3   pane id: …connection-info-2

The recreate itself is correct — a fresh instance replaced the live one in the same slot, siblings intact, zero console errors. Only the marker is gone.

The Problem

decorateFlipMarker(config, itemId) stamps dock-flip-item-<itemId> onto a pane config so the DockFlip main-thread addon can identify that pane across a re-projection and animate it from its old box to its new one. Three code paths produce a pane candidate. Two decorate; one does not.

The consequence is silent and permanent for that instance: nothing throws, nothing logs, the pane renders and works. It simply stops participating in motion, so the next layout change snaps it into place while its siblings animate. A user sees an inconsistent dock; a consumer keying on the marker (CSS, an e2e locator, a debug overlay) sees the pane vanish.

Note this is reachable by default now. hasDockRecreateFallback() answers a constant true because the base resolveFreshPane delegates to resolvePane, so every consumer that returns a config from resolvePane — the documented normal case — gets a live reload action and therefore this path.

The Architectural Reality

path producer decorated
projection src/dashboard/dock/Workspace.mjs:2616 — this.decorateFlipMarker(this.resolvePane(itemId, item), itemId) ✅
rail reveal src/dashboard/dock/Workspace.mjs:2314 — resolveRevealComponentRef: (…) => me.decorateFlipMarker(me.resolveRevealPane(itemId, item), itemId) ✅
recreate src/dashboard/dock/Workspace.mjs — prepareRecreateCandidate calls this.resolveFreshPane(itemId, item) raw ❌

decorateFlipMarker is defined at src/dashboard/dock/Workspace.mjs:1098. The base resolveFreshPane (:2655) returns this.resolvePane(itemId, item) — the undecorated resolver, not the decorated wrapper at :2616 — which is the precise point at which the marker is lost.

Phase 2 (commitRecreateCandidate) then inserts the candidate through container.insert(index, candidate), so whatever the candidate carries is what the live slot gets. The transaction is otherwise sound: insert-then-remove with destroy: false, so no window exists in which the slot is empty.

The Fix

Decorate at the recreate site, in prepareRecreateCandidate:

candidate = this.decorateFlipMarker(this.resolveFreshPane(itemId, item), itemId)

Chosen over fixing the base resolveFreshPane to delegate to the decorated wrapper, because a consumer that overrides resolveFreshPane (the documented extension point for a cache-backed factory) would still return an undecorated candidate and re-open the same gap. Decorating what the hook returns covers the base and every override with one line.

decorateFlipMarker must remain tolerant of a non-config candidate: a consumer may legitimately return a live component instance from resolveFreshPane, and phase 1's own live-instance guard only rejects the predecessor instance, not any instance. Confirm its current behaviour on an instance input before changing the call site.

Contract Ledger Matrix

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
dock-flip-item-<itemId> class on a pane Workspace#decorateFlipMarker (src/dashboard/dock/Workspace.mjs:1098) present on every projected pane including one produced by recreate unchanged for the two paths that already decorate learn/guides/uibuildingblocks/DockLayouts.md describes FLIP motion; no doc change needed measured 3 → 2 marked panes across one reload while widget count held at 3
Workspace#resolveFreshPane src/dashboard/dock/Workspace.mjs:2655 contract unchanged — consumers keep returning a config or an instance override-safe: the caller decorates, not the hook JSDoc on the member base delegates to resolvePane, verified at :2655

| Workspace#prepareRecreateCandidate | Existing decorateFlipMarker and projection semantics | Plain-config candidates return a decorated shallow copy preserving supplied values; component candidates preserve identity and predecessor-instance refusal | Existing threw, declined, and live-instance outcomes unchanged | Method/helper JSDoc | Distinct-candidate and five FLIP arms |

Decision Record impact

aligned-with ADR 0029 — the docking record's FLIP-motion and recreate clauses both stand; this is an implementation gap against them, not a change to either. No ADR amendment required.

Acceptance Criteria

  • prepareRecreateCandidate decorates the candidate returned by resolveFreshPane, so a recreated pane carries dock-flip-item-<itemId>.
  • A red-first unit arm proves the gap before the fix: a workspace whose resolvePane returns a plain config, recreated, asserts the marker present — failing on current dev.
  • A consumer that overrides resolveFreshPane also receives a decorated candidate (the override case is the reason for the chosen call site, so it needs its own arm).
  • decorateFlipMarker's behaviour on a live-component candidate is asserted, so the tolerant path is a contract rather than an accident.
  • No change to the two paths that already decorate, and no double-stamping when a candidate already carries the marker.
  • Existing dock unit + component tiers stay green.

Out of Scope

  • The recreate transaction's structure. Insert-then-remove with destroy: false is correct and is not touched.
  • Whether reload should be enabled by default. hasDockRecreateFallback() returning a constant true is deliberate per its own JSDoc and is a separate question.
  • Any consumer-side workaround. Three candidate paths with one rule between them is exactly the shape that must not be re-derived per consumer.
  • FLIP motion behaviour itself — this restores a pane's eligibility for it, it does not change the animation.

Avoided Traps

  • Fixing it in the consumer. The tempting one-liner is for the app's resolveFreshPane to stamp the marker itself. That is how a single engine rule becomes three consumer re-derivations; the same class of mistake as the drop-preview positioning that three consumers each re-derived before #18142 moved it into the engine.
  • Fixing the base resolveFreshPane instead of the call site. Reads cleaner and silently excludes every consumer override, which is the documented extension point.
  • Asserting the marker in a downstream consumer's e2e tier. An arm that reds until an engine bump lands makes that tier untrustworthy for the whole interval; the witness belongs here, next to the code.

Related

  • #18142 — the drop-preview geometry that three consumers each re-derived before the engine absorbed it; same anti-pattern, cited as precedent for where this fix belongs.
  • #18283 — the reload journey witnessing engine recreate for a pane without the delegation contract; that arm passes without noticing the marker, which is how this survived.
  • Epics #18303 / #18304 — the ownership arc this path sits inside.

Creation Gates

  • Live latest-open sweep: checked the latest 20 open issues at 2026-09-07T12:55:53; no equivalent found (nearest neighbours #18275 lazy-pane double construct and #18208 item-only refresh override — neither is this).
  • A2A in-flight claim sweep: 30 most recent messages, all read-states, scanned immediately before creation; no overlapping [lane-claim] / [lane-intent].
  • Agent OS Structure Map Gate: N/A — no new or relocated .mjs file; the change is one call site inside an existing engine module.

Handoff Retrieval Hints

  • query_raw_memories — "recreate path does not stamp the FLIP marker, decorateFlipMarker three call sites"
  • Grep anchors: decorateFlipMarker (3 call sites in src/dashboard/dock/), prepareRecreateCandidate, commitRecreateCandidate.
  • The misdiagnosis trail is worth reading before writing the arm: a marker-keyed locator reports a live recreated pane as destroyed, which is the failure mode this ticket also removes.

Origin Session ID: fffad262-5537-4e4a-869d-69bce1c81b6b