LearnNewsExamplesConnect
Frontmatter
assigneesneo-gpt-sophie
createdAtNov 12, 2026, 11:28 AM
updatedAtNov 12, 2026, 2:57 PM
githubUrlhttps://github.com/neomjs/neo/issues/20820
authorneo-gpt-sophie
commentsCount0
parentIssue20667
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 12, 2026, 2:57 PM

RowGeometry supports an ordered Collection as its input

Closed v14.0.0/archive-v14-0-0-chunk-1 documentationenhancementaigrid
neo-gpt-sophie
neo-gpt-sophie commented on Nov 12, 2026, 11:28 AM

Context

A rendering owner can maintain an ordered Neo.collection.Base of existing records without introducing a second Store. Neo.grid.RowGeometry already consumes that Collection-shaped input, but documents its store config and change hook as Neo.data.Store. This leaf makes the supported input contract explicit and guards it beside the existing geometry tests.

Parent: #20667. Separate from #20681's extra-height capability.

The Problem

At be8d0b0340c8671d488a3dfe5e12d111c72cee38, src/grid/RowGeometry.mjs reads count, items, and Observable on/un. It listens for mutate, sort, filter, and load, but does not call a Store-only accessor. A plain Collection supports the required order events; a Store additionally emits load.

The current type permits a future Store-only dependency without exposing that an ordered-Collection consumer would break. Existing geometry tests use Stores, so that compatibility boundary has no direct regression.

Design authority: this is an additive documented compatibility contract. Existing grid behavior and the Collection's mutation semantics are preserved.

The Architectural Reality

  • RowGeometry.afterSetStore owns subscription replacement, early event ordering and height-cache reset on source replacement.
  • rebuild reads the input's ordered items; getRecordId is supplied by the consumer and stays authoritative for keyed heights.
  • Collection emits mutate/sort/filter; data.Store extends it. An unlinked Collection owns its ordered list, not a writable link to another source.
  • test/playwright/unit/grid/RowGeometry.spec.mjs already covers offsets, lookup, invalidation and the grid consumers.

Prescription checked: document and test the existing owner. No extraction or new geometry class is needed.

The Fix

Type the input and hook arguments as Neo.collection.Base|null. State the read/subscription contract and that source mutation remains the caller's responsibility. Add a focused test using an actual plain Collection and explicit record-key resolver; drive splice, sort, filter/clear and source replacement through real events, then verify geometry reads without calling its invalidator manually.

Contract Ledger

Surface Authority Behavior Edge Docs Evidence
RowGeometry store config / afterSetStore Existing implementation, explicitly supported here Accept ordered Collection or Store through items/count/on/un; follow emitted order events null is empty; replacing the input clears known heights JSDoc Plain-Collection and existing Store tests
Keyed height reads Existing getRecordId/setHeights/offsetAt/indexAt contract Heights follow record keys through order/filter changes Unmeasured records use estimate; source replacement starts fresh Existing JSDoc Numeric assertions after each real event

Decision Record: Optional. Decision Record impact: none; no algorithm, ownership or event-law change.

Acceptance Criteria

  • The config and hook JSDoc name Collection, the required members/events, and the caller's ordering/key responsibility.
  • A real plain Collection drives geometry through splice, sort and filter/clear; offsets, total height and index lookup reflect each order without a manual invalidation call.
  • Known heights follow retained keys; a replacement Collection clears the old source's heights, and detachment produces empty geometry.
  • Existing Store/grid geometry tests still pass. No runtime algorithm or grid behavior changes.

Out of Scope

Extra heights (#20681), a new geometry service, independent editable record truth, automatic record-field filtering, rendering/measurement/scroll correction, and package module loading.

Avoided Traps

Copying prefix arrays; relabeling a mock as Collection support; forcing callers to construct a Store solely for geometry; calling onStoreChange from the test; changing linked-Collection write-through semantics.

Ownership and sweep

Sophie self-selects this bounded compatibility dependency. No contributor claim is displaced. Structural placement: existing source and spec; no new directory. Agent OS structure map: N/A.

Live latest-open + closed sweep: all 38 open issues read (orange band), latest20 refreshed immediately before filing, plus closed RowGeometry Collection search. Closed #9486 concerns multi-body grid architecture and excludes no ordered-input contract; open #20681 covers extra heights, not this boundary. Latest30 all-read-state A2A scan found no competing geometry claim. Own assignments: #20185, unrelated video work. Memory sweeps recovered the prior geometry source/Collection probes; KB did not retrieve the specific class, so exact source governs. No equivalent leaf or prior exclusion found.

Origin Session ID: 9bf9ac41-3a89-436f-9bdb-2e38327937eb

Retrieval Hint: "RowGeometry Store type ordered Collection input items count order events compatibility"

tobiu referenced in commit 57e2ae9 - "docs(grid): support Collection input for row geometry (#20820) (#20822)" on Nov 12, 2026, 2:57 PM
tobiu closed this issue on Nov 12, 2026, 2:58 PM