stage #4613 (dso2ng): preserve reader scroll position across re-render/reload (#4675)

Sticky-unpin across idle renderMessages(), 3-tier anchor restore (data-message-anchor-key
-> data-session-msg-idx -> data-msg-idx) for tail-window->full-session reloads, deferred
external refresh while unpinned (flushed on explicit scrollToBottom), iOS/touch momentum
protection. CONFLICT RESOLVED with tonight's shipped #4584: kept #4584's deltaY<-30
jitter-resistant unpin threshold AND #4613's _markMessageTouchScrollIntent(true) on touchmove
(both present, 34 scroll-family tests pass). Authoritative head 03343e04b3f2.

Co-authored-by: nesquena-hermes <agent@nesquena-hermes>
Co-authored-by: dso2ng <dso2ng@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2026-06-21 23:57:24 -07:00
1 parent 0456003c84
commit 3edbec7c97
9 files changed
+276 -38

No files matched your search

+8
View File
@@ -47,6 +47,14 @@ def test_scroll_listener_prefetches_older_messages_only_when_enabled():
assert "el.scrollTop<80 && typeof _messagesTruncated" not in UI_JS
def test_touch_momentum_defers_endless_scroll_prefetch():
assert "const MESSAGE_TOUCH_SCROLL_SUPPRESS_MS=1200" in UI_JS
assert "function _recentMessageTouchScrollIntent()" in UI_JS
assert "function _scheduleDeferredOlderMessagesLoad()" in UI_JS
assert "if(_recentMessageTouchScrollIntent()) _scheduleDeferredOlderMessagesLoad();" in UI_JS
assert "else _loadOlderMessages();" in UI_JS
def test_endless_scroll_i18n_keys_exist_for_each_locale():
assert I18N_JS.count("settings_label_session_endless_scroll") == I18N_JS.count("settings_label_workspace_panel_open")
assert I18N_JS.count("settings_desc_session_endless_scroll") == I18N_JS.count("settings_desc_workspace_panel_open")