LearnNewsExamplesConnect
Frontmatter
assigneesRazepriv
createdAtNov 10, 2026, 1:31 AM
updatedAtNov 17, 2026, 11:20 AM
githubUrlhttps://github.com/neomjs/neo/issues/20681
authorneo-opus-grace
commentsCount3
parentIssue20667
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined1
signals[]
blockedBy[]
blocking[ ] 20911 Row geometry: a row''s extra height lies below its cells
closedAtNov 17, 2026, 11:20 AM

Row geometry: an extra height per row that the estimate ignores

Closed v14.0.0/archive-v14-0-0-chunk-1 enhancementhelp wantedgood first issueaigrid
neo-opus-grace
neo-opus-grace commented on Nov 10, 2026, 1:31 AM

Please comment to claim before starting; check current assignees and linked PRs.

Context

In content-sized mode, Neo.grid.RowGeometry holds one height per record and estimates every unmeasured row from the mean of the measured ones. That mean works for rows sized by their cells. It goes wrong as soon as a row grows by something that is not a cell: a detail panel under an expanded row, an inline form, a notes strip. That extra height enters the same mean.

The Problem

RowGeometry stores one height per record (setHeights, src/grid/RowGeometry.mjs:334), and measuredMean averages all of them (:117). After each measure batch, grid.View re-derives the estimate for unmeasured rows from that mean: View#runAheadMeasure calls setRowHeights(heights, true) (src/grid/View.mjs:1264). A batch covers the visible rows plus eight beyond each overscan edge.

So a consumer that grows a row by an extra part has to pass the composite height, and the composite height moves the estimate. With illustrative numbers: 50 measured rows of 32px, one of them expanded by a 300px panel, give a mean of 38px. Every unmeasured row of a 100k-row grid is then estimated about 19% too tall, and the scroll extent shrinks back as rows get measured. Allowing only one expanded row bounds the error to extra / measured rows, which is largest exactly when the first screen is measured.

A font refresh also drops the extra: View#commitFontHeights calls rowGeometry.clearHeights() and re-applies the measured text heights only (View.mjs:806–815).

The Architectural Reality

  • RowGeometry owns the row heights, the offsets and the estimate of one view. grid.View is its only writer, through the scroll-stable #changeRowHeights path (setRowHeights, resetRowHeights, commitFontHeights).
  • measuredMean's JSDoc: "Mean height of measured records, or null before the first measurement. Unseen rows do not count".
  • Design authority: n/a. This adds a capability, and the estimate keeps its meaning: the mean of measured heights.
  • Precedent: the content-sized rows work in #19668, #19674 and #19688.

The Fix

  • RowGeometry#setExtraHeights(heights): a Map<recordId, Number> of extra px per record, kept beside the measured heights.
    • A row's height is its measured height, or the estimate, plus its extra. Offsets and totalHeight include the extra.
    • 0 or null removes an entry.
    • measuredMean stays the mean of the measured heights only.
    • clearHeights() keeps the extras, because a font refresh re-measures text, not panels. A new store starts without any, as it does for measured heights.
  • grid.View#setRowExtraHeights(heights) applies them through #changeRowHeights, so the row at the scroll offset holds still. During a thumb drag it waits for the drag's end, as setRowHeights does.

Contract Ledger

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
Neo.grid.RowGeometry#setExtraHeights(heights) this ticket extra px per record id, added to the row's height and excluded from measuredMean 0 or null removes an entry; a record outside the current order keeps its extra for a later full pass, as measured heights do JSDoc test/playwright/unit/grid/RowGeometry.spec.mjs
Neo.grid.View#setRowExtraHeights(heights) this ticket applies extras through the scroll-stable mutation path a view without row geometry (fixed-height mode) returns false JSDoc unit spec

Acceptance Criteria

  • measuredMean ignores extras: measured heights of 32 and 32, plus an extra of 300 on one of the records, keep the mean at 32 (unit).
  • Offsets and totalHeight include extras, and removing an extra restores them (unit).
  • clearHeights() keeps extras (unit).
  • When an extra above the row at the scroll offset changes, View#setRowExtraHeights keeps that row still on screen (unit or e2e, following the existing content-sized specs).
  • Fixed-height grids are unaffected: they have no RowGeometry, and setRowExtraHeights returns false.

Out of Scope

  • Any component that renders the extra part, such as a detail panel or an editor.
  • Which rows may grow, and whether they shrink when scrolled away. That stays the consumer's UX choice, and this ticket makes it independent of the estimate.

Related

  • #20667: the engine seams packages build on. This is a rendering primitive.
  • #19668, #19674, #19688: the content-sized rows this extends.

Good first issue: the change is local to RowGeometry and one grid.View method, both already have unit specs to extend, and the ACs are numeric. Run npm run test-unit -- test/playwright/unit/grid/RowGeometry.spec.mjs. I review the PR it draws.

unowned-rationale: Ready for a contributor; maintainers provide planning and review.

Live latest-open + closed sweep: I read the latest 20 open issues (13 open, green band) and ran a closed search ("row height estimate measuredMean extra height expand"), with no hits. I also listed the PRs touching RowGeometry, which are the content-sized arc above. No equivalent or prior exclusion exists. A2A claim sweep: the last 30 messages in all read states carry no claim on RowGeometry or row heights. MC sweep ("expanded row detail height skews the unseen row estimate RowGeometry measuredMean"): 5 results, no prior decision. Own-assignment sweep: unowned by design.

Origin Session ID: 469a295a-e67c-485c-bdb2-e61ebbd6ddb0

Razepriv
Razepriv Nov 13, 2026, 12:52 AM

I'd like to claim this one.

Plan:

  • RowGeometry: keep a second Map<recordId, Number> of extras beside #heights, with setExtraHeights(heights) (0/null deletes). rebuild() and the setHeights() fast path write measured ?? estimate plus the extra into #rowHeights, so offsets and totalHeight follow without touching #heightSum, and measuredMean stays the mean of measured heights only. The rebuild() shortcut that skips resolving record ids when no height is known will also check for extras. clearHeights() leaves the extras alone; a new store clears both.
  • grid.View#setRowExtraHeights(heights): goes through #changeRowHeights like setRowHeights, waits for the end of a thumb drag the same way, and returns false without a rowGeometry.
  • Tests: extend test/playwright/unit/grid/RowGeometry.spec.mjs with the first three ACs (mean stays 32 with a 300 extra, offsets/totalHeight with and without the extra, clearHeights() keeps extras), plus a View-level unit for the scroll anchor and the fixed-height false, following the existing content-sized specs.

Prepared with Claude Code (Claude Opus 5.5); I review and run everything before it goes up.

  • 2026-11-12T23:52:56Z @github-actions assigned to @Razepriv

@github-actions - 2026-11-12T23:52:57Z

Thanks for claiming this, @Razepriv, and welcome! Assigned to you — you can start now.

Your claim reserves this issue for 3 days (any comment here resets the clock; we still merge the first approve-worthy PR if another lands first or a claim goes quiet).

An automatic reply. How claims work [QUARANTINED_URL: github.com]

  • 2026-11-13T23:45:14Z @neo-opus-grace cross-referenced by #20911
  • 2026-11-13T23:45:34Z @neo-opus-grace marked this issue as blocking #20911
  • 2026-11-15T16:20:45Z @neo-opus-vega cross-referenced by #21032
Razepriv
Razepriv Nov 16, 2026, 12:02 AM

Still on this. The specs are written: the model ACs in RowGeometry.spec.mjs, and the View ACs (anchor correction, thumb drag, store replacement) in AnchorCorrection.spec.mjs. The implementation is next. #20822 (Collection input) was already in my base and doesn't change the plan, since extras are keyed by record id through getRecordId the same way as measured heights. I expect to open the PR within the next day.

Razepriv cross-referenced by PR #21243 on Nov 17, 2026, 10:42 AM