LearnNewsExamplesServices
Frontmatter
id18844
titlelist.plugin.Animate fades the wrong rows when one filter pass adds and removes
stateClosed
labels
bugai
assigneesneo-fable-clio
createdAtSep 18, 2026, 12:57 PM
updatedAtSep 18, 2026, 1:43 PM
githubUrlhttps://github.com/neomjs/neo/issues/18844
authorneo-fable-clio
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtSep 18, 2026, 1:43 PM

list.plugin.Animate fades the wrong rows when one filter pass adds and removes

neo-fable-clio
neo-fable-clio commented on Sep 18, 2026, 12:57 PM

Context

Surfaced 2026-09-18 by the Institution's FleetGridScaleNL arm at engine dev@3f859a4803: the scenario passes, and the worker-error fixture (#18554) reports

App Worker: TypeError: Cannot read properties of undefined (reading 'style')
    at src/list/plugin/Animate.mjs:645:30   (removedItems.forEach, inside onStoreFilter's timeout)

The throw is the loud end of a quiet defect that has been there as long as the method.

The Problem

onStoreFilter splices the added rows into vdom.cn first, waits 50 ms, then fades the removed rows. Outside an interception it resolves a removed row by obj.index — its index in data.oldItems — against a vdom.cn that already holds the added rows:

  • old [alpha, bravo, delta], new [charlie, echo] → vdom.cn = [charlie, echo, alpha, bravo, delta]; the removed rows' old indexes 0/1/2 hit charlie, echo, alpha. The entering rows fade out, two leaving rows stay fully visible until the settle pass rebuilds the list.
  • If anything rebuilt vdom.cn inside those 50 ms (a store load, a sort), the old index points past its end → the TypeError above. The added-rows loop two blocks up reads vdom.cn[index].style by position the same way.

Removals-only passes (the common narrowing filter) are correct by coincidence: old index equals vdom index.

Found while writing the arms: the by-id lookup itself derives the item id from the record KEY (owner.getItemId(obj.record[key]), also in the reAdded check), while a list with the default useInternalId: true builds its item ids from store.getInternalId(record). On such a list the lookup never matches — which is why the moved-rows loop silently does nothing there. The rest of the file already derives it correctly (owner.getItemId(owner.getRecordId(record))).

Found by this ticket's own arms in CI: triggerTransitionCallback arms a raw setTimeout and destroy() never clears it. A list destroyed inside a transition leaves the timer running; it fires on a plugin whose owner is gone — TypeError: Cannot read properties of null (reading 'createItems') at Animate.mjs:773 — inside whichever code runs next (in the unit tier: the next test, which is how it showed up as a flake on the first push).

The Architectural Reality

src/list/plugin/Animate.mjs — onStoreFilter (:554), getItemIndex(obj, map, intercept) (:448): intercept false → positional obj.index; true → map.indexOf(owner.getItemId(key)). Inside the timeout the method rebuilds map from the live vdom.cn precisely because "new items are already added into the vdom, while old items are not yet removed", and the moved-rows loop already passes true ("honor removed items, even without interceptions"). The added and removed loops beside it do not.

The Fix

Inside the timeout callback all three loops resolve by id (getItemIndex(obj, map, true)): a row is found where it is, and a row that is gone answers -1 and is skipped. The id comes from owner.getRecordId(record), so internal-id and key-id lists resolve alike. The positional read stays where it is correct — the pre-timeout splice, which needs the insertion index.

Acceptance Criteria

  • Red-first unit arm (test/playwright/unit/list/animatePlugin.spec.mjs): a filter pass that swaps the visible set fades exactly the leaving rows (opacity 0) and shows exactly the entering ones (opacity 1) during the transition.
  • Red-first unit arm: a list rebuilt inside the 50 ms window throws nothing and fades no surviving row.
  • Red-first unit arm: a list destroyed inside a transition clears its settle timer.
  • The existing filter arms (filtering fades removed items out…, component-list filtering settles…) stay green.

Out of Scope

The interception path's own index logic; the sort path (onStoreSort); measured row height.

Avoided Traps

Guarding vdom.cn[index]?.style silences the throw and keeps fading the wrong rows.

Related

#18554 (the fixture that made it visible) · #18604 (last change to this plugin) · neomjs/neo-agent-institution#151 (the consumer pin that surfaced it)

Decision Record impact: none.

Live latest-open sweep: latest 20 open issues read at 2026-09-18T10:56Z + an all-state search (Animate plugin filter removed index) — nothing equivalent (#17554 is list.Buffered windowing). A2A sweep: latest 50 messages, no claim on this file. Memory Core: problem-keyed query returned only my own #18604 design turn and unrelated grid animation history — no prior decision. Own open assignments (#12964, #15000, #15243, #16742): no overlap.

Origin Session ID: 1ef6c04a-10f6-4977-ad7d-0e2c7f343c59 Retrieval Hint: "Animate plugin onStoreFilter removed rows positional index vdom.cn already holds added rows wrong row fades"

tobiu referenced in commit 70c2c94 - "fix(list): the Animate plugin fades the rows that leave, found by id, when one filter pass adds and removes (#18844) (#18845) on Sep 18, 2026, 1:43 PM
tobiu closed this issue on Sep 18, 2026, 1:43 PM