HERMES-GIELIE/static
webtecnica 25d39da00e fix(stream): preserve reader viewport anchor through live-to-settlement collapse
Issue #6385: when a streaming turn settles, the two-render sequence
(keep-open expanded worklog → collapsed worklog) could displace the
reader's viewport because the second render captured its scroll snapshot
from the intermediate expanded state, not from the original live DOM.

Root cause
----------
The STREAM_DONE handler in messages.js:

1. Arms keep-settled-worklog-open token → renderMessages({preserveScroll:true})
   → worklog rendered EXPANDED (height-stable swap preventing shrink jump)

2. Disarms token → _renderMessagesWithScrollSnapshot()
   → This function called _captureMessageScrollSnapshot() which captured
     the scroll anchor from the expanded-worklog DOM (step 1 output),
     then called renderMessages with the worklog COLLAPSED (keep-open gone),
     then tried to restore from the expanded-state snapshot.

   The snapshot's semantic anchor (row key, session idx, top offset) was
   captured from a DOM where the worklog was expanded. After the collapse
   render the worklog is no longer at that position — anchor keys don't
   match, the semantic restore fails, and the viewport jumps to a
   unrelated scrollTop.

Fix
---
- Capture the scroll snapshot from the LIVE DOM (before any settlement
  renders) and pass it as  to the second render.
- Modify _renderMessagesWithScrollSnapshot() to accept a pre-captured
  snapshot via options._prescrollSnapshot, using it instead of capturing
  a fresh one from the current DOM state.

This ensures the collapse render anchors to the content the reader was
actually viewing, not to a stale intermediate expanded-worklog position.

Co-authored-by: webtecnica <webtecnica@users.noreply.github.com>
2026-07-21 02:12:06 -03:00
..
vendor fix: protect pipes inside backtick code spans in renderMd tables 2026-06-25 08:25:58 +00:00
__init__.py Release: pip-installable packaging metadata (#6337, @rodboev) (#6344) 2026-07-20 02:17:52 +00:00
apple-touch-icon.png Swap brand to new cyan caduceus: favicon family, titlebar + empty-state logo (theme-safe navy badge), remove per-skin titlebar fill overrides 2026-06-28 07:44:16 +00:00
assistant_turn_anchors.js Release: Live Stream Anchor side-effects projection (#6204, @franksong2702) (#6348) 2026-07-20 04:56:51 +00:00
boot.js Release: add preference to hide new-chat welcome panel (#6183, @vaidu-ai) (#6387) 2026-07-21 04:45:11 +00:00
commands.js fix(sessions): guard all auto-mint paths + strict config/body parsing (gate review) 2026-07-14 04:35:06 +00:00
extension_settings.js fix(extensions): prune malformed browser overrides (#5094) 2026-06-28 18:31:43 -04:00
favicon-32.png Swap brand to new cyan caduceus: favicon family, titlebar + empty-state logo (theme-safe navy badge), remove per-skin titlebar fill overrides 2026-06-28 07:44:16 +00:00
favicon-192.png Swap brand to new cyan caduceus: favicon family, titlebar + empty-state logo (theme-safe navy badge), remove per-skin titlebar fill overrides 2026-06-28 07:44:16 +00:00
favicon-512.png Swap brand to new cyan caduceus: favicon family, titlebar + empty-state logo (theme-safe navy badge), remove per-skin titlebar fill overrides 2026-06-28 07:44:16 +00:00
favicon-512.svg Swap brand to new cyan caduceus: favicon family, titlebar + empty-state logo (theme-safe navy badge), remove per-skin titlebar fill overrides 2026-06-28 07:44:16 +00:00
favicon.ico Swap brand to new cyan caduceus: favicon family, titlebar + empty-state logo (theme-safe navy badge), remove per-skin titlebar fill overrides 2026-06-28 07:44:16 +00:00
favicon.svg Swap brand to new cyan caduceus: favicon family, titlebar + empty-state logo (theme-safe navy badge), remove per-skin titlebar fill overrides 2026-06-28 07:44:16 +00:00
i18n.js Release: add preference to hide new-chat welcome panel (#6183, @vaidu-ai) (#6387) 2026-07-21 04:45:11 +00:00
icons.js stage #4581 onto master (v0.51.556) — surface escape-target symlinks as display-only workspace rows 2026-06-21 09:15:22 +00:00
index.html Release: add preference to hide new-chat welcome panel (#6183, @vaidu-ai) (#6387) 2026-07-21 04:45:11 +00:00
login.js Fix login connectivity retry cleanup: clearInterval not clearTimeout 2026-07-09 03:41:42 +00:00
manifest.json
messages.js fix(stream): preserve reader viewport anchor through live-to-settlement collapse 2026-07-21 02:12:06 -03:00
onboarding.js fix(webui): give the onboarding password inputs a form owner too 2026-07-15 10:41:16 +02:00
outline.js Release: msg_limit ceiling + row-loss-safe pagination (#6152 + #6154, @rh-id) (#6213) 2026-07-17 20:15:40 -07:00
panels.js Release: add preference to hide new-chat welcome panel (#6183, @vaidu-ai) (#6387) 2026-07-21 04:45:11 +00:00
pwa-startup.js
sessions.js Release: Artifacts filename-first + session-own-streaming + reduced-motion msg-row (#6161, #6165, #6166, @webtecnica) (#6282) 2026-07-18 17:53:57 -07:00
share.html Rebase #5337 (public read-only conversation sharing) onto master 2026-07-11 01:39:42 +00:00
share.js Rebase #5337 (public read-only conversation sharing) onto master 2026-07-11 01:39:42 +00:00
style.css Release: add preference to hide new-chat welcome panel (#6183, @vaidu-ai) (#6387) 2026-07-21 04:45:11 +00:00
sw.js fix: focus the existing chat tab when a notification is clicked instead of opening a new tab 2026-06-13 14:42:41 -07:00
terminal.js Handle terminal output EventSource transport errors 2026-07-09 02:26:20 +00:00
ui.js fix(stream): preserve reader viewport anchor through live-to-settlement collapse 2026-07-21 02:12:06 -03:00
workspace.js Release: Artifacts pane long-filename readability + long-parent containment (#6078, @rodboev) (#6386) 2026-07-21 04:39:25 +00:00