Repository navigation
Stop the timeline fighting Android text selection handles - #8006
Merged
ymichael merged 1 commit intoNov 22, 2026
Merged
Conversation
Dragging a selection handle in Android Chrome sends the page no touch or pointer events. Chrome extends the selection by hit-testing under the handle and scrolls the timeline to reveal the new end. Three things broke that: - The scroll keeper saw those reveal scrolls as unexplained and, at the bottom of a thread, wrote them back to the end. It now follows a scroll without input while text inside the timeline is selected. - bb's selection menu sits just below the end handle and covered the next line, so dragging the handle onto that line could not extend the selection. While a touch selection is up and no finger is down, the root carries data-touch-text-selection and the menu ignores hit-testing. The next pointerdown restores hit-testing before the tap is resolved, so a tap on the menu still lands. - The menu never followed the selection while handles moved: React Compiler cached the Popover anchor element because its virtualRef was a stable ref object. The ref object now changes with the anchor. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
deleted the
bb/fix-android-text-selection-scrolling-thr_mwr63qrvc3
branch
November 22, 2026 04:01
k0d3r1s
added a commit
to valksor/vbb
that referenced
this pull request
Nov 24, 2026
Brings upstream get-bb#8006 (Android timeline text selection) and get-bb#7994 (per-session agent writable folders). Conflict resolution keeps the fork's protocol numbering at 286 with upstream's 277 incompatible, adopts the per-thread resolveThreadWorkspaceWriteRoots flow alongside the fork's MCP session binding in the daemon thread handlers, updates fork test fixtures for the new required additionalWorkspaceFolders and folders contract fields, and keeps both sides' bridge test fixtures.
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.
Human comments
What was wrong
On Android Chrome, dragging a text selection handle sends the page no touch or pointer events. Chrome only fires
selectionchangeand scrolls the timeline itself to keep the handle in view. Three things went wrong as a result:ScrollPositionKeepertreated Chrome's reveal scroll as unexplained and wrote the scroll position back to the bottom. In one recorded drag, Chrome scrolled to 6065 and the keeper wrote 6075 back. The content moved under the finger, so the selection landed on the wrong text.<Popover.Anchor virtualRef={ref}>, because the ref object never changed. Radix's anchor effect never re-ran, and the menu stayed where the selection started.What changed
scroll-position-keeper.ts: while a non-collapsed selection is inside the timeline, the keeper follows scrolls that have no input instead of restoring the old position.New
lib/touch-selection-passthrough.ts, installed frommain.tsx: setsdata-touch-text-selectionon the root when all of these hold:Any
pointerdownremoves the attribute synchronously, before Chrome's GestureTap hit test, so a tap on the menu still lands. The module does nothing on iOS WebKit.app.css::root[data-touch-text-selection] [data-touch-selection-passthrough] { pointer-events: none; }. The rule is unlayered so it beats Tailwind's layeredpointer-events-auto.TimelineSelectionMenu.tsx:data-touch-selection-passthrough;useMemokeyed on the anchor, so the popover moves when the selection does.The timeline, diff, secondary panel and terminal all share this menu.
Not fixed: dragging a handle up past the timeline onto the title bar makes Chrome extend the selection to the first loaded text, and the view jumps to the top. Chrome takes that position from the header's layout box rather than from hit-testing, so making the header
pointer-events: nonedoes not help. A fix would need the scroller to extend under the header, or a JS guard.How you verified
Android emulator, Chrome, real thread data. The branch build was served in front of a running server and observed over CDP:
menuTop430 = last rect bottom 400 + 24 + 6).New tests:
scroll-position-keeper.test.ts: two tests, one following a scroll with no input while text in the timeline is selected, and one keeping the end when the selection is outside the timeline.TimelineSelectionMenu.test.tsx: the menu moves when the selection extends.touch-selection-passthrough.test.ts: four tests covering the settle, a pointerdown restoring hit-testing, a collapsed selection, and mouse selections.The keeper test and the menu test fail with the pre-fix files and pass with the fix.
pnpm exec turbo run typecheck lint test --filter=@bb/apppasses (702 files, 7346 tests).🤖 Generated with Claude Code