LearnNewsExamplesServices
Frontmatter
id18874
titleAnimate''s measured rows are uniform, its items are not
stateClosed
labels
enhancementdesignai
assigneesneo-fable-clio
createdAtSep 18, 2026, 2:36 PM
updatedAtSep 18, 2026, 3:41 PM
githubUrlhttps://github.com/neomjs/neo/issues/18874
authorneo-fable-clio
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtSep 18, 2026, 3:41 PM

Animate's measured rows are uniform, its items are not

Closed v13.2.0/archive-v13-2-0-chunk-21 enhancementdesignai
neo-fable-clio
neo-fable-clio commented on Sep 18, 2026, 2:36 PM

Context

list.plugin.Animate's measured mode (#18604: owner itemHeight: null + measureItemHeight: true) takes the tallest rendered item as the list's one row height. Tried on its first real consumer today — the Institution's fleet roster (neomjs/neo-agent-institution#128) — it splits in two:

  • Homogeneous items (the calm roster, every card the same anatomy): 126 px fixed rows become 104 px, no dead reserve. The intended win.
  • Mixed items (one card shows a control-status row, another a two-line lane): the pitch follows the tallest card in the whole list while every other card stays as tall as its own content. Short cards float in tall slots — the gaps read as cards again, the defect the consumer ticket set out to remove.

Operator design ruling on the captures (2026-09-18): cards in a grid have the same height.

The Problem

The mode measures items, so it cannot size them: createItem writes no inline height in measured mode on purpose (Animate.mjs, "no inline height: the item is as tall as its content, which is what gets measured"). A written height would be what the next measurement reads — in both directions: an element with an inline height answers a rect read with that height whatever its content does, so the row would freeze at its first measurement (measured while building the fix: unit and real-DOM mutation, the row stays at its first value). That guard is correct, and it is exactly what leaves the items ragged: uniform pitch, non-uniform items.

Fixed mode has no such split — style.height = owner.itemHeight makes item, slot and (through the consumer's height: 100%) surface one thing. Measured mode needs the same equality without that trap.

The Architectural Reality

  • src/list/plugin/Animate.mjs: createItem (the mode branch), measureItems → owner.getDomRect(ids) over the item ids, token-fenced; rowHeight getter; repositionItems.
  • src/main/DomAccess.mjs: getBoundingClientRect, getLayoutRect — neither answers "how tall would this element be if its inline height were released".
  • DomAccess.measure({id, value}) is the nearest sibling and the placement precedent (the main thread answering a size the worker cannot compute), but it answers a different question: it converts one CSS length to px for one node — % as a fraction of the offsetParent's height, any other unit through an off-screen measuring div — for component.Base#measure (the floating/align path, its only caller). It never reads an element's own natural size, it is single-node where this read must batch (release all → read all → restore all, or it thrashes layout per item), and its two branches already measure different axes. Overloading it (value: 'auto') would inherit that ambiguity; the new read sits beside it instead.
  • Consumers size the surface off the item: the roster's > .fm-agent-card {height: 100%}, the list example's cards.

The Fix — options, each with its falsifier

Option Shape Falsifier
A — measure the content, size the slot measure each item's content element (component lists: the item component's root) and write height: rowHeight on the li the content must then NOT stretch to the li (height: 100% re-arms the trap), so an equal-height surface has to be painted by the li — every consumer restyles, selection and focus rings included
B — a natural-height read in one main-thread task a DomAccess read that releases the inline height of the given elements, reads their rects and restores it inside one task (release all → read all → restore all: one forced layout for any number of items, no painted intermediate frame); the plugin then writes height: rowHeight on every item, as fixed mode does cost at a few hundred items; an item whose own CSS transitions height
C — CSS variable + min-height publish the row height on the list root, items take min-height: var(…) the measured element includes its min-height: grow-only by construction

Recommendation: B. It keeps fixed mode's consumer contract (item = slot = surface) so a consumer switches modes by config alone, and the trap is closed where it lives — in the read.

Contract Ledger

Target surface Source of authority Proposed behaviour Fallback Docs Evidence
Neo.list.plugin.Animate measured mode — item height Animate.mjs#createItem, #measureItems (read at dev@70c2c94618) every item carries height: rowHeight once measured; before the first measurement it stays hidden and height-less, as today fixed mode unchanged the measureItemHeight_ member doc; examples/list/animate unit arms: equal item heights after a settle; a row that grew shrinks back when its tall item leaves
Neo.main.DomAccess.getNaturalRect (+ the component.Base#getNaturalRect shortcut, beside getLayoutRect) — the LAYOUT box, so the answer can be written back as a CSS length DomAccess.mjs remote-method list (getBoundingClientRect is the sibling) for the given ids: release the named inline properties (properties, default ['height']), read their layout boxes, restore the values with their priority — one task callers that never pass it are untouched method JSDoc component-tier arm (a real DOM): the element's inline height and its priority are identical before and after, the returned height is its content's

Behaviour change since #18604 (shipped 2026-09-14, one example consumer): measured items were content-height; they become row-height.

Acceptance Criteria

  • In measured mode every rendered item has the same height, equal to rowHeight, after each settle pass.
  • The row still shrinks: when the tallest item leaves or shortens, the next measurement publishes the smaller height (red-first against a written-height implementation without the natural read).
  • No frame paints a released height (the read is one main-thread task).
  • Fixed mode is byte-identical in behaviour; the #18604 token fence still drops a stale read.
  • examples/list/animate "Measured rows" renders equal cards in the browser, through filter and mode switches; mixed content is witnessed on a real DOM in the component tier (the example's cards share one natural height).

Out of Scope

Per-row heights (each row as tall as its own tallest item) — a different geometry (cumulative y), worth its own ticket if a consumer needs it. Variable item widths.

Avoided Traps

Writing the measured height back without changing the read (the row freezes at its first measurement). A hidden clone per item to measure (doubles the DOM and drifts from the real item's container queries — the roster card is container-type: inline-size).

Related

#18604 · #18670 · #18844 · neomjs/neo-agent-institution#128 (blocked on this)

Decision Record impact: none.

Live latest-open sweep: latest 20 open issues read at 2026-09-18T12:35Z + an all-state search (Animate measured row height equal stretch) — nothing equivalent. A2A sweep: latest messages carry no claim on list/plugin/Animate.mjs beyond my own merged #18844. Memory Core: my #18604 design turn recorded "variable per-row heights = stage two"; no decision covers equal-height items. Own open assignments: no overlap.

Origin Session ID: 1ef6c04a-10f6-4977-ad7d-0e2c7f343c59 Retrieval Hint: "Animate measured mode equal item heights natural-height read one task grow-only trap roster cards same height"