Commit ea8e493
fix(53-05): re-measure recycled rows on every window commit (CR-01)
Root cause: virtual-core@3.17.1's Virtualizer.measureElement(node) is the
SOLE caller of observer.observe() (dist/esm/index.js:794-817). DataTable's
windowing engine called it once at mount (remeasureWindow in $onMount) for
the FIRST window only, so rows that recycle into view on scroll got new DOM
nodes that were never observed — they kept the 40px estimateRowHeight seed
forever and getTotalSize() never converged to the real measured total,
defeating variable-height windowing (req-2).
Fix (entirely inside the $props.virtual guard; non-virtual r-else path
byte-identical):
- onChange now schedules a per-commit remeasureWindow() sweep, deduped via a
remeasurePending flag (at most one rAF per frame) and deferred one frame so
the recycled <tr> nodes exist before measuring.
- remeasureWindow() bails while virtualizer.scrollState is non-null (a
programmatic scrollToIndex in flight) so measuring can't nudge the offset
and starve the D-12 scroll-then-focus target — the regression that initially
broke the Solid off-window focus path. Manual-scroll recycling has
scrollState===null, so it measures normally.
- WR-01: windowedRows() filters out rows whose vi.index outruns $data.rows
(avoids wr.row.id deref on a transient shrink).
- WR-05: dropped the unreachable `ver < 0` sentinel guards (windowVer only
increments); the bare windowVer read still performs the subscription.
- IN-01/IN-04: corrected the false "virtual-core auto-registers rows" comment
and added the subscribe-first back-reference to padBottom().
Verification gate (closes the gap that let CR-01 pass): strengthened
data-table-virtual.spec.ts with a CR-01 case that drives the var-height
fixture top→bottom so every row recycles, then asserts getTotalSize converges
above the estimate. FAILS pre-fix (~20.3k, all 6) / PASSES post-fix (~26.3k,
all 6). data-table-virtual 48/48 + data-table-grid 18/18 green ×6 in the
pinned Linux Playwright container; whole-repo build 135/135; dist-parity
875/875 zero drift.
Deferred: WR-02/03/04 (reactive virtual/estimate prop tracking, empty-dataset
teardown sweep, aria-rowcount coupling) + IN-02/03.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013wvxhsB5hcDKD8UadLLSyw1 parent e46e600 commit ea8e493
8 files changed
Lines changed: 563 additions & 89 deletions
File tree
- packages/ui/data-table
- packages
- angular/src
- lit/src
- react/src
- solid/src
- svelte/src
- vue/src
- src
- tests/visual-regression/specs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
840 | 840 | | |
841 | 841 | | |
842 | 842 | | |
| 843 | + | |
843 | 844 | | |
844 | 845 | | |
845 | 846 | | |
| |||
1073 | 1074 | | |
1074 | 1075 | | |
1075 | 1076 | | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
1076 | 1089 | | |
1077 | 1090 | | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
1078 | 1100 | | |
1079 | 1101 | | |
1080 | 1102 | | |
| |||
1086 | 1108 | | |
1087 | 1109 | | |
1088 | 1110 | | |
1089 | | - | |
| 1111 | + | |
1090 | 1112 | | |
1091 | 1113 | | |
1092 | 1114 | | |
| |||
1101 | 1123 | | |
1102 | 1124 | | |
1103 | 1125 | | |
1104 | | - | |
1105 | 1126 | | |
1106 | 1127 | | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
1107 | 1132 | | |
1108 | 1133 | | |
1109 | 1134 | | |
1110 | | - | |
| 1135 | + | |
1111 | 1136 | | |
1112 | 1137 | | |
1113 | | - | |
| 1138 | + | |
1114 | 1139 | | |
1115 | | - | |
1116 | | - | |
| 1140 | + | |
| 1141 | + | |
1117 | 1142 | | |
1118 | 1143 | | |
1119 | 1144 | | |
1120 | 1145 | | |
1121 | | - | |
1122 | | - | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
1123 | 1150 | | |
1124 | 1151 | | |
1125 | 1152 | | |
| |||
1132 | 1159 | | |
1133 | 1160 | | |
1134 | 1161 | | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
1135 | 1170 | | |
1136 | 1171 | | |
1137 | 1172 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
785 | 785 | | |
786 | 786 | | |
787 | 787 | | |
| 788 | + | |
| 789 | + | |
788 | 790 | | |
789 | 791 | | |
790 | 792 | | |
| |||
1088 | 1090 | | |
1089 | 1091 | | |
1090 | 1092 | | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
1091 | 1105 | | |
1092 | 1106 | | |
1093 | 1107 | | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
1094 | 1118 | | |
1095 | 1119 | | |
1096 | 1120 | | |
| |||
1101 | 1125 | | |
1102 | 1126 | | |
1103 | 1127 | | |
1104 | | - | |
| 1128 | + | |
1105 | 1129 | | |
1106 | 1130 | | |
1107 | 1131 | | |
| |||
1116 | 1140 | | |
1117 | 1141 | | |
1118 | 1142 | | |
1119 | | - | |
1120 | 1143 | | |
1121 | 1144 | | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
1122 | 1149 | | |
1123 | 1150 | | |
1124 | 1151 | | |
1125 | | - | |
| 1152 | + | |
1126 | 1153 | | |
1127 | 1154 | | |
1128 | 1155 | | |
1129 | | - | |
| 1156 | + | |
1130 | 1157 | | |
1131 | | - | |
1132 | | - | |
| 1158 | + | |
| 1159 | + | |
1133 | 1160 | | |
1134 | 1161 | | |
1135 | 1162 | | |
1136 | 1163 | | |
1137 | 1164 | | |
1138 | | - | |
1139 | | - | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
1140 | 1169 | | |
1141 | 1170 | | |
1142 | 1171 | | |
| |||
1151 | 1180 | | |
1152 | 1181 | | |
1153 | 1182 | | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
1154 | 1191 | | |
1155 | 1192 | | |
1156 | 1193 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| 125 | + | |
125 | 126 | | |
126 | 127 | | |
127 | 128 | | |
| |||
474 | 475 | | |
475 | 476 | | |
476 | 477 | | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
477 | 490 | | |
478 | | - | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
479 | 501 | | |
480 | 502 | | |
481 | 503 | | |
| |||
486 | 508 | | |
487 | 509 | | |
488 | 510 | | |
489 | | - | |
| 511 | + | |
490 | 512 | | |
491 | 513 | | |
492 | 514 | | |
| |||
501 | 523 | | |
502 | 524 | | |
503 | 525 | | |
504 | | - | |
505 | 526 | | |
506 | 527 | | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
507 | 532 | | |
508 | 533 | | |
509 | 534 | | |
510 | | - | |
| 535 | + | |
511 | 536 | | |
512 | 537 | | |
513 | | - | |
| 538 | + | |
514 | 539 | | |
515 | | - | |
516 | | - | |
| 540 | + | |
| 541 | + | |
517 | 542 | | |
518 | 543 | | |
519 | 544 | | |
520 | 545 | | |
521 | | - | |
522 | | - | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
523 | 550 | | |
524 | 551 | | |
525 | 552 | | |
| |||
532 | 559 | | |
533 | 560 | | |
534 | 561 | | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
535 | 570 | | |
536 | 571 | | |
537 | 572 | | |
| |||
0 commit comments