emrg: GUI scroll capture fix — back-to-bottom + history load respond to session-view scrolls - #764
Conversation
…to session-view scrolls Regression from #634 (per-session .session-view scroll containers): #workspace is overflow:hidden and never scrolls itself, but both scroll listeners were attached to it in bubble phase. Native scroll events do NOT bubble, so: - back-to-bottom button never appeared in the real GUI (tests dispatched scroll directly on the wrapper, masking the bug) - scroll-to-top older-history load never fired (same cause) - returning from a panel view (v0.2 #762) always jumped to bottom, violating the rant acceptance "scroll position preserved" (browser-tab semantics) Fix: - attach both #workspace scroll listeners with capture: true so child .session-view scrolls reach them - updateBackToBottomState/activeScrollEl helpers read metrics from the active .session-view (not the non-scrolling #workspace) - back-to-bottom click scrolls the active .session-view - activateSessionView only scrolls to bottom for newly-created containers; existing containers preserve their scroll position (panel round-trip / session switch no longer jump) - setWorkspaceChrome hides back-to-bottom in panel views, restores per position when returning to session view Tests: +1 renderer.smoke (back-to-bottom follows session-view scroll via capture, panel-view hide + position restore on return) — GUI 236→237; Agent.md count synced; pytest 801 green.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — self-review (1/3). Local: GUI 237/237 (new scroll-capture regression test), pytest 801, node --check clean, doc-count guard 3/3. CI test + test-windows PASS. Diff verified: capture:true on #workspace scroll listeners; metrics read from active .session-view via activeScrollEl; activateSessionView preserves scroll for existing containers (browser-tab semantics per rant acceptance); panel view hides back-to-bottom + restores on return.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — self-review (1/3). Verified locally: GUI tests 237/237 (new regression test covers scroll-up → back-to-bottom shows + autoScroll=false, click → scrollTop=scrollHeight + button hides, panel view → button force-hidden, return to session → button restored per scroll position), pytest 801, doc-count guard green (Agent.md 236→237 sync). CI 31695553181 test + test-windows PASS, MERGEABLE.
Root-cause audit confirms correctness:
- Native scroll events do NOT bubble → previous bubble-phase listener on #workspace never fired (workspace is overflow:hidden; actual scrollers are .session-view children) — real-GUI silent regression since #634, also hit v0.2 workspace views (#762).
- Fix uses capture: true on the #workspace listeners (both back-to-bottom and history-load) → captures child .session-view scrolls. Correct mechanism.
- activeScrollEl() resolves the real scroller (active session view, falling back to first .active child / workspace); back-to-bottom click scrolls the resolved element.
- activateSessionView scrolls to bottom ONLY for newly-created containers (existed check) — preserves scroll position on panel round-trip / session switch, satisfying the rant 18:55:09 acceptance.
- setWorkspaceChrome('panel') force-hides back-to-bottom; 'sessions' restores via updateBackToBottomState().
No issues found; awaiting 2 more ✅ from independent cycles.
|
I tested this PR end-to-end (head b3b7246) and found the fix is correct and complete: |
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle (3/3). Fresh verification on head b3b7246: pytest 801 passed, GUI 237/237 passed, node --check clean. Diff reviewed: capture:true scroll listeners reach child .session-view (scroll doesn't bubble); metrics via activeScrollEl from the scrolling container; activateSessionView preserves scroll position for existing containers (browser-tab semantics per rant 18:55:09 acceptance); panel view hides back-to-bottom, restores per position on return. CI test + test-windows PASS. Merging.
…764) (#765) Document the scroll-capture regression fix (back-to-bottom + scroll-to-top history load were dead in the real GUI because native scroll events don't bubble past the non-scrolling #workspace wrapper; capture-phase listeners + per-session metrics + scroll-position preservation for existing containers). Merged f46b141. Co-authored-by: EMRG Evolution <emrg@argszero.dev>
Summary
Fixes a silent regression from #634 (per-session
.session-viewscroll containers) that also affected the v0.2 workspace views (#762).Problem
#workspaceisoverflow: hiddenand never scrolls itself — the actual scrollers are the.session-view.activechildren. Both scroll listeners were attached to#workspacein the bubble phase, but nativescrollevents do not bubble, so:Fix
#workspacescroll listeners withcapture: trueso child.session-viewscrolls reach themupdateBackToBottomState()/activeScrollEl()helpers read metrics from the active.session-view(not the non-scrolling#workspace).session-viewactivateSessionViewonly scrolls to bottom for newly-created containers; existing containers preserve their scroll position (panel round-trip / session switch no longer jump)setWorkspaceChromehides back-to-bottom in panel views, restores per position when returning to session viewVerification