Isolate webchat message scrolling from host scroll hijacking#48
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
overscroll-behavior,touch-action, and Lenis prevention attributes on the messages container.wheelandtouchmovepropagation from inside the message scroller and cleaned those listeners up on disconnect.Testing
yarn test __tests__/controllers/webchat_controller_test.jsyarn buildyarn testNote
Low Risk
Scoped to the messages container scroll UX and event propagation; no auth, API, or data-path changes.
Overview
This PR keeps webchat conversation scrolling working when the host page uses smooth-scroll libraries (e.g. Lenis) that would otherwise capture wheel/touch gestures.
On connect, the messages container gets scroll-containment styles (
overscroll-behavior,touch-action, iOS momentum scrolling) and Lenis prevent data attributes. Capture-phase, passivewheelandtouchmovelisteners callstopHostScrollPropagationso those events do not bubble to the host. Disconnect removes those listeners alongside existing teardown.The diff adds Jest coverage for setup, propagation blocking, and listener cleanup in
webchat_controller_test.js.Reviewed by Cursor Bugbot for commit 31f79ca. Bugbot is set up for automated code reviews on this repo. Configure here.