Commit 9f9632b
fix(virtual-core): key scroll retirement off where the scroll parked
Review follow-up. Retirement was gated on a reachedTarget boolean that was
re-armed only when the target moved more than a viewport, on the grounds
that measurement settling nudges it a pixel or two. That left a gap: a
retarget larger than the 1.01px arrival tolerance but smaller than the
viewport kept the scroll marked as arrived while it was genuinely
travelling to the new target, so the next prepend retired it early and
stranded the reader — the same class of bug as cancelling an in-flight
smooth scroll, just in a narrower window.
Replace the boolean with arrivedAtOffset: the offset the scroll actually
came to rest at, or null while travelling. Cleared whenever reconcile
re-drives the scroll and recorded again when it next comes to rest, so
"arrived, then the reader moved away" is compared against where we parked
rather than against a target that measurement settling has since moved.
Retirement no longer consults viewport size at all.
Adds a regression test for the sub-viewport retarget. Both existing tests
still hold, and each of the three fails on exactly one of the earlier
revisions:
pristine unconditional viewport arrivedAt
clobbered anchor FAIL pass pass pass
in-flight smooth pass FAIL pass pass
sub-viewport retarget pass FAIL FAIL pass
react-virtual e2e clean over 20 consecutive runs; marko 82 x2, angular
13 x3, core 131/131, repo-wide eslint/types/lib/build green.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 88c894a commit 9f9632b
2 files changed
Lines changed: 120 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
| |||
650 | 650 | | |
651 | 651 | | |
652 | 652 | | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
653 | 657 | | |
654 | 658 | | |
655 | 659 | | |
| |||
668 | 672 | | |
669 | 673 | | |
670 | 674 | | |
| 675 | + | |
671 | 676 | | |
672 | 677 | | |
673 | 678 | | |
| |||
689 | 694 | | |
690 | 695 | | |
691 | 696 | | |
692 | | - | |
693 | | - | |
694 | | - | |
695 | | - | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
696 | 703 | | |
697 | 704 | | |
698 | 705 | | |
699 | | - | |
700 | | - | |
| 706 | + | |
| 707 | + | |
701 | 708 | | |
702 | 709 | | |
703 | 710 | | |
| |||
885 | 892 | | |
886 | 893 | | |
887 | 894 | | |
888 | | - | |
889 | | - | |
890 | | - | |
891 | | - | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
892 | 899 | | |
893 | 900 | | |
894 | 901 | | |
895 | 902 | | |
896 | | - | |
| 903 | + | |
897 | 904 | | |
898 | 905 | | |
899 | 906 | | |
| |||
1094 | 1101 | | |
1095 | 1102 | | |
1096 | 1103 | | |
1097 | | - | |
| 1104 | + | |
1098 | 1105 | | |
1099 | 1106 | | |
1100 | 1107 | | |
| |||
1130 | 1137 | | |
1131 | 1138 | | |
1132 | 1139 | | |
1133 | | - | |
1134 | | - | |
1135 | | - | |
1136 | | - | |
1137 | | - | |
1138 | | - | |
1139 | | - | |
1140 | | - | |
1141 | | - | |
1142 | | - | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
1143 | 1148 | | |
1144 | 1149 | | |
1145 | 1150 | | |
| |||
1854 | 1859 | | |
1855 | 1860 | | |
1856 | 1861 | | |
1857 | | - | |
| 1862 | + | |
1858 | 1863 | | |
1859 | 1864 | | |
1860 | 1865 | | |
| |||
1889 | 1894 | | |
1890 | 1895 | | |
1891 | 1896 | | |
1892 | | - | |
| 1897 | + | |
1893 | 1898 | | |
1894 | 1899 | | |
1895 | 1900 | | |
| |||
1911 | 1916 | | |
1912 | 1917 | | |
1913 | 1918 | | |
1914 | | - | |
| 1919 | + | |
1915 | 1920 | | |
1916 | 1921 | | |
1917 | 1922 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3802 | 3802 | | |
3803 | 3803 | | |
3804 | 3804 | | |
| 3805 | + | |
| 3806 | + | |
| 3807 | + | |
| 3808 | + | |
| 3809 | + | |
| 3810 | + | |
| 3811 | + | |
| 3812 | + | |
| 3813 | + | |
| 3814 | + | |
| 3815 | + | |
| 3816 | + | |
| 3817 | + | |
| 3818 | + | |
| 3819 | + | |
| 3820 | + | |
| 3821 | + | |
| 3822 | + | |
| 3823 | + | |
| 3824 | + | |
| 3825 | + | |
| 3826 | + | |
| 3827 | + | |
| 3828 | + | |
| 3829 | + | |
| 3830 | + | |
| 3831 | + | |
| 3832 | + | |
| 3833 | + | |
| 3834 | + | |
| 3835 | + | |
| 3836 | + | |
| 3837 | + | |
| 3838 | + | |
| 3839 | + | |
| 3840 | + | |
| 3841 | + | |
| 3842 | + | |
| 3843 | + | |
| 3844 | + | |
| 3845 | + | |
| 3846 | + | |
| 3847 | + | |
| 3848 | + | |
| 3849 | + | |
| 3850 | + | |
| 3851 | + | |
| 3852 | + | |
| 3853 | + | |
| 3854 | + | |
| 3855 | + | |
| 3856 | + | |
| 3857 | + | |
| 3858 | + | |
| 3859 | + | |
| 3860 | + | |
| 3861 | + | |
| 3862 | + | |
| 3863 | + | |
| 3864 | + | |
| 3865 | + | |
| 3866 | + | |
| 3867 | + | |
| 3868 | + | |
| 3869 | + | |
| 3870 | + | |
| 3871 | + | |
| 3872 | + | |
| 3873 | + | |
| 3874 | + | |
| 3875 | + | |
| 3876 | + | |
| 3877 | + | |
| 3878 | + | |
| 3879 | + | |
| 3880 | + | |
| 3881 | + | |
| 3882 | + | |
| 3883 | + | |
| 3884 | + | |
| 3885 | + | |
| 3886 | + | |
| 3887 | + | |
0 commit comments