fix: canonicalize the frozen-row boundary across all comparison sites - #1268
Conversation
The row-band boundary was compared differently at six sites, contradicting each other and the render split (rows >= actualFrozenRow render in the bottom canvas): - appendRowHtml classed rows 'frozen' via row <= frozenRow (a COUNT compare): in bottom mode the first frozenRow+1 scrollable rows were classed and the actually-pinned rows never were; off-by-one in top mode - cleanupRows and cleanUpCells exempted <= actualFrozenRow, sparing the first SCROLLABLE row from cache eviction and cell cleanup in top mode - _getContainerElement (getCanvasNode/getViewportNode) classified with >= actualFrozenRow + 1 in top mode, returning the TOP pane for a row whose DOM lives in the BOTTOM canvas (overlay/menu positioning via the public API mis-targeted exactly the boundary row) - scrollRowIntoView used actualFrozenRow - 1 boundaries, refusing to scroll the LAST scrollable row in bottom mode (navigateToPos, one screen away, already used the correct comparison) All sites now route through two predicates matching the render split: isBottomBandRow (row >= actualFrozenRow) and isFrozenRowIdx (frozenBottom ? row >= actualFrozenRow : row < actualFrozenRow). Net -5 lines. Downstream note: slickgrid-universal maintains its own fork of this grid (verified by clone+grep - it does not consume this file at runtime), so this cannot break it; its fork carries the same isBottomSide off-by-one and may want to port the fix. Adds a permanent SELF-HOSTING regression test (cypress/e2e/quirk-frozen- row-boundary.cy.ts) with one check per drifted site. Verified pre-fix failures on every site (frozen class [0,1,2,3] in BOTH modes; pane lookup disagreement; scroll refusal; no eviction) and all-pass with the fix; frozen-family suites incl. the merged quirk specs ran 27/27. NOTE: examples/example-quirk-frozen-row-boundary.html is a TEMPORARY human-review repro page (tinted .frozen rows + pane-lookup/scroll readouts) intended to be deleted before merge - the cypress test does not depend on it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
I replicated this PR as well but it seems to cause a constant error in Cypress test I asked copilot to summarize why it might be failing because I have the same example and test, and it replied with:
Side note, I actually had to modify my similar Cypress test as well ( |
Port of ghiscoding/slickgrid-universal#2706: force the mousedown and first mousemove in dragStart (force was previously absent here) and release the drag with a body mouseup in dragEnd. The frozen-grid auto-scroll test failed constantly after the boundary canonicalization because the drag target's coordinates now land where the example page's descriptive text overlaps the grid under scrollBehavior:false; the assertions are unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Thanks for the pointer @ghiscoding — reproduced here too, and it was indeed failing constantly on this PR's CI ( Root cause checks out as test actionability rather than grid logic: the covered target is a live grid cell, and the covering element is the example page's own descriptive text ( Ported your #2706 hardening to |
The bug (Q3 in discussion #1247)
The frozen-row boundary was compared differently at six sites, contradicting each other and the render split (
rows >= actualFrozenRowrender in the bottom canvas):appendRowHtmlfrozen classrow <= frozenRow(a count compare).frozen, the actually-pinned rows never; top mode: off-by-onecleanupRows/cleanUpCells<= actualFrozenRow_getContainerElement(getCanvasNode/getViewportNode)>= actualFrozenRow + 1in top modescrollRowIntoViewactualFrozenRow - 1boundariesnavigateToPos, one screen away, already compares correctly)The fix
Two predicates matching the render split —
isBottomBandRow(row >= actualFrozenRow) andisFrozenRowIdx(frozenBottom ? row >= actualFrozenRow : row < actualFrozenRow) — with every site routed through them. Net −5 lines.Downstream check (executed)
slickgrid-universal maintains its own fork of this grid (verified by clone + grep — it does not consume this file at runtime), so this cannot break it. Its fork carries the same
isBottomSideoff-by-one and may want to port the fix.Test
cypress/e2e/quirk-frozen-row-boundary.cy.ts— self-hosting (harness viacy.intercept; no example-page dependency), one check per drifted site plus a frozen-row-stays-cached control. Pre-fix it fails on every drifted site with the predicted signatures (frozen class[0,1,2,3]in both modes;getCanvasNodereturning the top canvas while the row's DOM is in the bottom;scrollRowIntoView(996)leavingviewport.top=0; boundary row never evicted); post-fix all pass. Frozen-family suites including the merged #1255/#1258 quirk specs ran 27/27.examples/example-quirk-frozen-row-boundary.html(tinted.frozenrows + pane-lookup/scroll readouts) is intended to be deleted before merge — the cypress test is fully independent of it.(Quirks-triage remaining-items wave: see discussion #1247; siblings #1266, #1267.)