Skip to content

Recover compact sidebar swipes after interrupted drags - #4112

Merged
ymichael merged 1 commit into
mainfrom
bb/investigate-flaky-sidebar-swipe-thr_e2bgmgxf8g
Sep 22, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/investigate-flaky-sidebar-swipe-thr_e2bgmgxf8g

Conversation

@ymichael

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

A compact sidebar opening swipe sets openMobile=true at drag intent. If its terminal event is lost, the page can remain only partly translated while the drawer is logically open. Both touch and pointer start handlers then reject every later opening swipe until reload. Text-selection cancellation could clear an active drag without resetting that state. The end handlers also ignored the release coordinate, so sparse move events could settle a sufficient swipe closed. Fixes #4110.

What changed

  • Reset an interrupted active drag when the next eligible touch or primary pointer gesture starts. Keep normally opened drawers unaffected.
  • Reset an active drag when native text selection takes over.
  • Include the release position in the final swipe decision and match touch endings using changedTouches, so another finger's end does not terminate the tracked gesture.
  • Add regressions for lost terminal events on touch, pointer, and the iOS pointer-then-touch sequence; selection cleanup; sparse release coordinates; and another finger ending.

This changes only apps/app/src/components/ui/sidebar.tsx and its test. There are no server/daemon wire, CLI, SDK, configuration, or protocol changes.

How you verified

  • New interrupted-drag and release-position cases failed before the fix and pass after it.
  • pnpm exec turbo run test --filter=@bb/app -- src/components/ui/sidebar.test.tsx: 40 passed on the rebased head.
  • pnpm exec turbo run typecheck --filter=@bb/app: passed.
  • pnpm start:worktree --dryrun twice, then a persistent source server at the review app; server and daemon health passed.
  • A deterministic 390 × 844 Chromium touch procedure against that build omitted a touchend, observed data-state="open" with translate="20px", then confirmed the next swipe opened fully with no inline translation. It also passed text-selection cleanup, a tap without a swipe, normal opening and closing swipes, a trigger tap, and the desktop trigger. The procedure and output are in the originating BB thread's storage, outside this commit.
  • The intermittent phone report is a strong match for the reproduced stuck state; I did not reproduce it on a physical device.

Related PR #3544 recovered interrupted sessions before drag intent. This PR covers interruption after the drawer has become logically open.

BB-Thread-ID: thr_e2bgmgxf8g

AGENT GENERATED

@ymichael
ymichael merged commit 9e6e455 into main Sep 22, 2026
16 checks passed
@ymichael
ymichael deleted the bb/investigate-flaky-sidebar-swipe-thr_e2bgmgxf8g branch September 22, 2026 23:09
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.

Compact sidebar swipe can stay partly open after a lost end event

1 participant