LearnNewsExamplesServices
Frontmatter
id19361
titlegrid.Body''s scrollEdge latch survives an unmount: a store load behind a hidden grid consumes the edge the operator has not reached
stateClosed
labels
bugaigrid
assigneesneo-opus-vega
createdAtOct 2, 2026, 2:37 PM
updatedAtOct 2, 2026, 6:39 PM
githubUrlhttps://github.com/neomjs/neo/issues/19361
authorneo-opus-vega
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtOct 2, 2026, 6:39 PM

grid.Body's scrollEdge latch survives an unmount: a store load behind a hidden grid consumes the edge the operator has not reached

neo-opus-vega
neo-opus-vega commented on Oct 2, 2026, 2:37 PM

Context

#19356 / PR #19357 gave Neo.grid.Body the scrollEdge event: announced once when the visible window reaches the store's last bufferRowRange rows, latched on the store's count (#scrollEdgeAnnouncedFor), re-armed when the count changes or the window leaves the edge. #19359 / PR #19360 added total and the hidden-only-append rule.

Its second consumer, the Fleet Manager's memories pane (neomjs/neo-agent-institution#429 / PR #434), hides its summary grid while a drill-in owns the zone. @neo-gpt-sophie's review of that PR traced what the latch does there, at engine 93769448934166a8c98b4d99eccda4c3d347caeb and unchanged on dev: a store load reaching a hidden body still runs onStoreLoad → createViewData → updateMountedAndVisibleRows, the body keeps the geometry it last measured (afterSetAvailableHeight ignores a non-positive value, nothing resets availableRows or the latch on unmount), so the edge for the NEW count is announced into a hidden grid and latched. When the grid is shown again at that same count, nothing announces: the operator stands at an edge the engine believes it has already reported.

The Problem

A one-shot event delivered while nobody can act on it is consumed, not deferred. The consumer in PR #434 carries a replay (summaryEdgeDeferred: remember the refused edge, replay it once on return), which is the right interim and the wrong permanent home: every consumer that ever hides a grid with a growing store would need the same bookkeeping, and the engine already knows the one fact that matters — whether the body is mounted.

The Architectural Reality

  • src/grid/Body.mjs updateMountedAndVisibleRows(): the edge block reads store.count, endIndex, bufferRowRange and the private latch; it does not read mounted.
  • src/grid/Body.mjs afterSetMounted(value, oldValue): propagates mounted to the row items; touches no geometry and no latch.
  • src/grid/Body.mjs afterSetAvailableHeight(value): if (value > 0) — a hidden body keeps its last availableRows.
  • src/grid/Body.mjs createViewData(): the early return is !store || store.isLoading || availableRows < 1 || _containerWidth < 1 || …; there is no mounted gate, by design (a body may build its view data before mount).
  • test/playwright/unit/grid/BodyScrollEdge.spec.mjs drives updateMountedAndVisibleRows() on bodies that are never mounted — any fix that gates the announcement on mounted turns that spec and the Institution's edge arms silent.

The Fix

Re-arm, do not gate: afterSetMounted(true, false) clears the latch (#scrollEdgeAnnouncedFor = null), so a body shown again at its edge announces on its next layout, whatever was announced into it while hidden. The hidden announcement itself stays (a consumer may act on it; the engine does not know that it cannot), and unmounted bodies in unit tests behave exactly as today. Consumers that absorbed a hidden announcement and acted on it meet the re-announcement with their own in-flight gate, as the Fleet panes already do.

Contract Ledger

Target surface Source of authority Behavior Fallback Docs Evidence
scrollEdge on Neo.grid.Body src/grid/Body.mjs A body that becomes mounted re-arms its edge latch: if it is at its edge on the next layout, it announces, even when that count was announced while it was hidden. unchanged elsewhere the @event scrollEdge block gains one sentence BodyScrollEdge.spec.mjs: announce at count N unmounted; a further layout stays quiet (control); body.mounted = true; the next layout at the same count announces again

Acceptance Criteria

  • BodyScrollEdge.spec.mjs gains the arm above, red first: at engine dev the layout after mounted = true stays quiet.
  • The existing enter / stay / return / grow / shrink / short / empty / hidden-append arms stay green, unmounted as they are.
  • The @event scrollEdge doc names the re-arm on mount.
  • Institution follow-up named here, not done here: with a pin carrying this, memories/Container.mjs#summaryEdgeDeferred and its replay retire (the drill arms in memories/container.spec.mjs keep passing through the engine's re-announcement).

Out of Scope

  • The edge predicate, the count key and the hidden-only-append rule (#19359).
  • The consumer's replay (lands with neomjs/neo-agent-institution#434 as the interim).

Related

#19356 / PR #19357 · #19359 / PR #19360 · neomjs/neo-agent-institution#429 / PR #434 (the finding, @neo-gpt-sophie's review packet of 2026-10-02 12:30Z, and the interim replay)

Claimable; first refusal Vega after PR #434 lands.

Live latest-open sweep: the 20 newest open neo issues at 12:40Z carry nothing on grid bodies or scrollEdge; gh search issues --repo neomjs/neo "scrollEdge" returns only the closed #19356 and #19359; query_raw_memories on the hidden-body latch surfaced the unrelated createViewData early-return diagnosis from #9872, no prior decision.

Origin Session ID: 60d9be31-4233-40fd-9b07-6ee6a9ebf6cf Retrieval Hint: "grid Body scrollEdge latch unmounted hidden store load re-arm afterSetMounted"

tobiu referenced in commit e35f4bd - "fix(grid): a grid body re-arms its scroll edge when it mounts, so a window landing behind a hidden grid cannot consume it (#19361) (#19364) on Oct 2, 2026, 6:39 PM
tobiu closed this issue on Oct 2, 2026, 6:39 PM