Files
hermes-webui/static
nesquena-hermes 93f30ecfda fix(scroll): reset _lastScrollTop on session switch (Opus stage-302 follow-up)
Opus advisor on stage-302 (#1732 verification Q5) flagged that
_lastScrollTop is module-global and persists across chat switches. When
the user switches sessions, the new chat's first user scroll compares
against the previous chat's last scrollTop. If the previous was deep-
scrolled (e.g. 5000) and the new chat starts at top=0, scrolling down
to 100 would evaluate as movedUp=true → false-unpin, blocking auto-
scroll on the new chat's first incoming token.

Fix: expose _resetScrollDirectionTracker() from static/ui.js on window
so static/sessions.js loadSession() can reset _lastScrollTop=null when
S.session is reassigned. The scroll listener's existing _lastScrollTop!==null
guard then handles the first sample after reset correctly (no false-trigger
on the very first scroll event in the new chat).

Absorb-in-release per Opus stage-302 verdict — small, defensive, ≤20 LOC.
2026-05-06 08:21:42 +00:00
..
2026-05-05 01:51:05 +00:00