fix: prevent chat scroll resets after final render

Keep explicit bottom pins stable across late layout growth and make clicking the already-active sidebar session a no-op before loadSession mutates state. Update scroll regression tests for the delayed settle path.
This commit is contained in:
ai-ag2026 authored and nesquena-hermes committed 2026-05-08 20:48:43 +00:00
1 parent dec2d25fcc
commit c65ae46983
5 files changed
+147 -10

No files matched your search

+7 -3
View File
@@ -142,13 +142,17 @@ def test_downward_path_preserves_macos_momentum_hysteresis():
end_idx = block.index("const btn=", else_idx)
downward_branch = block[else_idx:end_idx]
assert "_nearBottomCount=nearBottom?_nearBottomCount+1:0" in downward_branch, (
assert "if(nearBottom)" in downward_branch, (
"Downward path must branch on near-bottom state so the macOS momentum "
"re-pin guard still applies (#1360)."
)
assert "_nearBottomCount=_nearBottomCount+1" in downward_branch, (
"Downward path must keep incrementing the near-bottom counter so "
"the macOS momentum re-pin guard still applies (#1360)."
)
assert "_scrollPinned=_nearBottomCount>=2" in downward_branch, (
assert "if(_nearBottomCount>=2) _scrollPinned=true" in downward_branch, (
"Downward path must keep the >=2 hysteresis re-pin requirement "
"(#1360)."
"without downgrading an explicit bottom pin on the first near-bottom event (#1360)."
)