Skip to content

Recover iOS sidebar swipes after interrupted touch sessions - #3544

Merged
SawyerHood merged 3 commits into
get-bb:mainfrom
salemsayed:codex/repro-ios-send-sidebar-swipe
Sep 12, 2026
Merged

SawyerHood merged 3 commits into
get-bb:mainfrom
salemsayed:codex/repro-ios-send-sidebar-swipe

Conversation

@salemsayed

@salemsayed salemsayed commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Human comments

What was wrong

The compact sidebar installs capture listeners before the Send control handles its pointer event. In iOS WKWebView, submitting a follow-up can blur the composer and detach the Send target before the matching terminal touch event reaches the window listener. That leaves swipeSessionRef occupied, so every later sidebar gesture is rejected until the page reloads.

What changed

  • Replace unfinished sidebar tracking when a fresh primary pointer or single-touch gesture begins.
  • Ignore non-primary pointer starts so a second finger cannot replace a valid gesture.
  • Keep the existing edge guard, swipe thresholds, passive vertical-scroll behavior, and target exclusions unchanged.
  • Add focused interrupted-session regression coverage, including the detached Send target sequence, missing pointer/touch terminal events, touch identifier reuse, vertical scrolling, and secondary fingers.
  • Add a Maestro iOS flow that records video and screenshots before Send and after Send, then asserts that the sidebar still opens.
  • Include that flow in the label-gated Mobile E2E default set so its media is uploaded with the workflow artifacts.

There are no server/daemon wire, CLI, SDK, configuration, or protocol changes.

How you verified

  • pnpm exec turbo run test --filter=@bb/app -- src/components/ui/sidebar.test.tsx src/components/promptbox/PromptBoxInternal.test.tsx: 166 tests passed. Five new regression cases fail without the implementation change.
  • pnpm exec turbo run typecheck --filter=@bb/app: passed.
  • pnpm exec turbo run test --filter=@bb/mobile -- src/lib/e2e/mobile-e2e-flows.test.ts src/lib/e2e/ci-run-flows.test.ts: 4 tests passed.
  • bash -n apps/mobile/e2e/scripts/ci-run-flows.sh: passed.
  • Physical iPhone, TestFlight shell, current source bundle served from an isolated direct server: before the patch, swipe-open worked after reload and stopped immediately after Send; with the patched bundle, swipe-open continued working after multiple sends.
  • Upstream CI passed before the Mobile E2E wiring follow-up; the updated CI run is linked on this PR.

Maintainer action for simulator media: add the mobile-e2e label. Contributor permissions cannot apply repository labels.

AGENT GENERATED

@salemsayed

Copy link
Copy Markdown
Contributor Author

Follow-up verification against latest upstream main:

  • Source: clean detached worktree at d4a7c3d993cbd3bf81ea7a9f18cac7f301d913fc; none of this PR was present.
  • Delivery: production web bundle served from a fresh isolated data directory through a distinct HTTPS origin, avoiding reuse of the patched WebView cache.
  • Device: the same physical iPhone/TestFlight shell used for the patched check.
  • Result: sidebar swipe-open worked before Send and stopped working immediately after Send again.

The isolated server, Tailscale endpoint, data directory, and temporary worktree were removed after the test.

AGENT GENERATED

@SawyerHood
SawyerHood merged commit db889a9 into get-bb:main Sep 12, 2026
14 checks passed
ymichael added a commit that referenced this pull request Sep 22, 2026
## 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](https://ymichael--19220.getbb.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
@salemsayed
salemsayed deleted the codex/repro-ios-send-sidebar-swipe branch October 1, 2026 10:42
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.

2 participants