Skip to content

fix: prevent chat scroll resets after final render#1926

Closed
ai-ag2026 wants to merge 1 commit into
nesquena:masterfrom
ai-ag2026:tars/scroll-reset-current-session
Closed

fix: prevent chat scroll resets after final render#1926
ai-ag2026 wants to merge 1 commit into
nesquena:masterfrom
ai-ag2026:tars/scroll-reset-current-session

Conversation

@ai-ag2026
Copy link
Copy Markdown
Contributor

Summary

  • keep explicit bottom scroll pins stable across final renderMessages({ preserveScroll: true }) and late Markdown/layout growth
  • make clicking the currently active sidebar session a no-op before loadSession() mutates state or resets scroll-affecting UI
  • update scroll regression tests for the delayed-settle helper and active-session no-op path

Root cause

The final-render path could write/rebuild DOM, queue native scroll events, and then lose the explicit bottom pin before delayed layout growth settled. Separately, clicking the already-open session still ran the loadSession() teardown/setup path, so an in-progress chat could jump back to the top even though the user did not navigate.

Related reconnaissance

Test plan

  • node --check static/ui.js
  • node --check static/sessions.js
  • git diff --check
  • env -u HERMES_WEBUI_PASSWORD -u HERMES_WEBUI_HOST -u HERMES_WEBUI_PORT TZ=UTC LANG=C.UTF-8 LC_ALL=C.UTF-8 PYTHONHASHSEED=0 uv run --with pytest --with pyyaml python -m pytest tests/test_tars_scroll_reset_regressions.py tests/test_issue1731_upward_scroll_unpins.py tests/test_streaming_markdown.py tests/test_streaming_sidebar_scroll.py tests/test_parallel_session_switch.py -q -o addopts= -> 104 passed
  • env -u HERMES_WEBUI_PASSWORD -u HERMES_WEBUI_HOST -u HERMES_WEBUI_PORT TZ=UTC LANG=C.UTF-8 LC_ALL=C.UTF-8 PYTHONHASHSEED=0 uv run --with pytest --with pyyaml python -m pytest -q -o addopts= -> 4857 passed, 43 skipped, 3 xpassed, 1 warning, 8 subtests passed
  • Added-line static scan: 0 findings

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.
@nesquena-hermes
Copy link
Copy Markdown
Collaborator

Shipped in v0.51.29 via the Release F batch (release PR #1934, merge SHA 596c6b3). Your work is now live on master.

🚀 Release notes: https://github.com/nesquena/hermes-webui/releases/tag/v0.51.29

Thanks for the contribution!

pull Bot pushed a commit to soitun/hermes-webui that referenced this pull request May 8, 2026
pull Bot pushed a commit to soitun/hermes-webui that referenced this pull request May 8, 2026
…persistence + scroll/lineage fixes + i18n cleanup)

Six-PR contributor batch:
- PR nesquena#1919 (franksong2702): Persist login rate limit attempts (closes nesquena#1910)
- PR nesquena#1920 (franksong2702): Remove dead Kanban start i18n key
- PR nesquena#1921 (Michaelyklam): Production Docker image hardening (closes nesquena#1908)
- PR nesquena#1926 (ai-ag2026): Prevent chat scroll resets after final render
- PR nesquena#1927 (ai-ag2026): Preserve viewport when loading older messages
- PR nesquena#1930 (ai-ag2026): Collapse stale compression sidebar segments

Tests: 4947 → 4960 (+13 net new). Browser API harness all-green.
Opus advisor: SHIP-READY. CHANGELOG conflict on nesquena#1919 auto-resolved
during stage rebase (CHANGELOG took ours strategy).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants