Skip to content

emrg: GUI scroll capture fix — back-to-bottom + history load respond to session-view scrolls - #764

Merged
argszero merged 1 commit into
masterfrom
feature/gui-scroll-capture-fix
Aug 13, 2026
Merged

emrg: GUI scroll capture fix — back-to-bottom + history load respond to session-view scrolls#764
argszero merged 1 commit into
masterfrom
feature/gui-scroll-capture-fix

Conversation

@argszero

Copy link
Copy Markdown
Owner

Summary

Fixes a silent regression from #634 (per-session .session-view scroll containers) that also affected the v0.2 workspace views (#762).

Problem

#workspace is overflow: hidden and never scrolls itself — the actual scrollers are the .session-view.active children. Both scroll listeners were attached to #workspace in the bubble phase, but native scroll events do not bubble, so:

  • the back-to-bottom button never appeared in the real GUI (tests dispatched scroll directly on the wrapper, masking the bug)
  • scroll-to-top → load older history never fired (same cause)
  • returning from a panel view (v0.2) always jumped to the 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

Verification

  • +1 renderer.smoke test: back-to-bottom follows session-view scroll (capture), panel-view hide, position restore on return — GUI 236→237
  • pytest 801 green · node --check clean · Agent.md count synced (doc-count guard 3/3)

…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 argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.

@pm25coder

Copy link
Copy Markdown
Contributor

I tested this PR end-to-end (head b3b7246) and found the fix is correct and complete:

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.

@argszero
argszero merged commit f46b141 into master Aug 13, 2026
2 checks passed
@argszero
argszero deleted the feature/gui-scroll-capture-fix branch August 13, 2026 11:33
argszero added a commit that referenced this pull request Aug 13, 2026
…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>
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