Skip to content

fix: auto-scroll stops following streaming after max height reached - #12

Merged
quiet-node merged 1 commit into
mainfrom
fix/autoscroll-second-message
Apr 1, 2026
Merged

fix: auto-scroll stops following streaming after max height reached#12
quiet-node merged 1 commit into
mainfrom
fix/autoscroll-second-message

Conversation

@quiet-node

Copy link
Copy Markdown
Owner

Summary

  • Replaced sync scroll-position check with wheel-event-based auto-scroll tracking to prevent layout-induced false negatives
  • The useLayoutEffect height-measurement cycle temporarily sets height: auto on the spring-animated parent, which can clamp scrollTop to 0 and fire a deferred scroll event that falsely disables auto-scroll once the container reaches max height (600px)
  • Wheel events are exclusively user-initiated (never fired by programmatic scrolls or layout reflows), making them a reliable signal for "user scrolled up"

Test plan

  • All 141 tests pass
  • 100% code coverage across lines, functions, branches, and statements
  • Lint, typecheck, and format checks pass
  • Manual test: send first message, let response stream past max height, send second message — verify auto-scroll follows streaming
  • Manual test: scroll up during streaming — verify auto-scroll stops
  • Manual test: scroll back to bottom during streaming — verify auto-scroll resumes

🤖 Generated with Claude Code

… negatives

The useLayoutEffect height-measurement cycle temporarily sets height:auto
on the spring-animated parent, which can clamp scrollTop to 0 and fire a
deferred scroll event that falsely disables auto-scroll at max container
height. Switch to wheel events (exclusively user-initiated) to detect
scroll-up intent, and re-enable auto-scroll when messages.length increases.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@quiet-node
quiet-node merged commit d84dc99 into main Apr 1, 2026
3 checks passed
@quiet-node
quiet-node deleted the fix/autoscroll-second-message branch April 1, 2026 20:28
quiet-node added a commit that referenced this pull request Apr 10, 2026
)

fix: use wheel events for auto-scroll to prevent layout-induced false negatives

The useLayoutEffect height-measurement cycle temporarily sets height:auto
on the spring-animated parent, which can clamp scrollTop to 0 and fire a
deferred scroll event that falsely disables auto-scroll at max container
height. Switch to wheel events (exclusively user-initiated) to detect
scroll-up intent, and re-enable auto-scroll when messages.length increases.

Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
quiet-node added a commit that referenced this pull request Apr 10, 2026
)

fix: use wheel events for auto-scroll to prevent layout-induced false negatives

The useLayoutEffect height-measurement cycle temporarily sets height:auto
on the spring-animated parent, which can clamp scrollTop to 0 and fire a
deferred scroll event that falsely disables auto-scroll at max container
height. Switch to wheel events (exclusively user-initiated) to detect
scroll-up intent, and re-enable auto-scroll when messages.length increases.

Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
quiet-node added a commit that referenced this pull request Apr 11, 2026
)

fix: use wheel events for auto-scroll to prevent layout-induced false negatives

The useLayoutEffect height-measurement cycle temporarily sets height:auto
on the spring-animated parent, which can clamp scrollTop to 0 and fire a
deferred scroll event that falsely disables auto-scroll at max container
height. Switch to wheel events (exclusively user-initiated) to detect
scroll-up intent, and re-enable auto-scroll when messages.length increases.

Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
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.

1 participant