Repository navigation
fix(chat): let sideways scrollers keep their drags over the drawer pull - #4187
Open
Lotuses-robot wants to merge 1 commit into
Open
Lotuses-robot wants to merge 1 commit into
Lotuses-robot wants to merge 1 commit into
Conversation
The drawer pull is a whole-screen Pan, so RNGH hands it every touch and the platform cancels the child ScrollView: a horizontal swipe on a code block or a table opened the drawer instead of scrolling that content. Wrap every horizontal scroller in HorizontalScroll, whose Gesture.Native is related to the drawer pan with blocksExternalGesture, so the drawer waits for the row to give up first. Rows that already fit cannot scroll, so the drag animates the platform's native edge bounce instead. This also drops the left-edge hitSlop and the measured cards band, which additionally swallowed the drawer over the non-scrolling wide grid layout.
Author
|
The \pytest (3.11)\ failure looks like a pre-existing race in the Xunfei TTS test, unrelated to this change:
Could a maintainer re-run the failed job? I don't have rights to re-run it on this repo. Happy to rebase or push an empty commit to retrigger if preferred. |
This branch has not been deployed
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.
What does this PR do?
A horizontal swipe on a code block or table in the chat opened the left session drawer instead of scrolling that content. The drawer pull is a native
Gesture.Pan()wrapped around the whole screen, and RNGH never consults which descendant a touch began in, so the pan won and the platform cancelled the childScrollView.This adds
mobile/src/components/HorizontalScroll.tsx, a shared wrapper for every horizontalScrollViewin the chat. It pairs the scroller with aGesture.Native()that is related to the drawer's pan viablocksExternalGesture, so the drawer waits for the row to give up first. A drag that begins over one of these rows scrolls the row; a drag that begins anywhere else still pulls the drawer out from anywhere on screen. The decision is made per touch by a handler relation, so nothing is measured or kept up to date as the list recycles rows.ChatScreen.tsxnow exposes the drawer gesture through a context ref, andMarkdown.tsx(fenced code blocks and tables),Intro.tsx(example cards) andDock.tsx(attachment tray) useHorizontalScroll.This replaces an earlier attempt that restricted the drawer swipe to a left-edge
hitSlop. That version stopped the drawer from stealing the drag, but removed the whole-screen pull. It also deletes the measured-band mechanism (onCardsBand/bandTop/bandBottom), which had the same dead-end problem and additionally swallowed the drawer over the non-scrolling wide grid layout.A row whose content already fits cannot scroll, so the drawer does not open over it; the drag animates that row's native edge bounce instead.
Type of change
Checklist
Ref #4185