Skip to content

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

Closed

Description

@ymichael

Summary

On a compact viewport, an opening sidebar swipe can leave the page only partly shifted if its terminal touch or pointer event never reaches the handler. The drawer is then logically open, so later opening swipes are ignored until a reload. A separate quick-swipe path ignores the release coordinate and can settle closed despite sufficient travel.

Versions and environment

  • Source app 0.43.4 at b2ff250e5efb93e0cb4a954d7c63680d53b6d4a4 (origin/main at reproduction), run through pnpm start:worktree on macOS with Node 22.23.1.
  • Deterministic compact browser procedure uses Chromium at 390 × 844 with synthesized DOM touch events. The reported intermittent physical-device behavior is a strong match, not a physical-device reproduction.

Steps to reproduce

  1. Start the source app on a fresh store and open it at a 390 × 844 touch viewport.
  2. Start a rightward touch at (40, 350) inside [data-sidebar="inset"]; move to (60, 350) and deliberately omit touchend/touchcancel.
  3. Start a new touch at (40, 350) with a new identifier; move to (190, 350) and release.
  4. Inspect [data-sidebar="panel"] state and [data-sidebar="inset"] inline translate after 220 ms.
  5. For the text-selection variant, select text inside [data-sidebar-swipe-selectable] after step 2 and dispatch selectionchange.

The thread-storage browser procedure used for the fix also covers a tap, normal opening and closing swipes, and the desktop trigger. The regression tests in apps/app/src/components/ui/sidebar.test.tsx failed against the pre-fix handler for touch and pointer interruption.

Expected vs actual

Expected after step 3: the next valid swipe recovers and fully opens the sidebar with no leftover inline translation.

Actual before the fix: the panel remains data-state="open", but the inset retains style.translate="20px"; the new swipe is rejected. After text selection, the swipe session can be cleared while the drawer remains logically open.

Evidence

  • Drag intent commits openMobile=true before the gesture ends: source.
  • Both new-gesture paths reject openMobile, including the interrupted state: touch, pointer.
  • Text-selection cancellation clears tracking without resetting the partially dragged drawer: source.
  • Related PR Recover iOS sidebar swipes after interrupted touch sessions #3544 recovered interrupted sessions before drag intent, but does not cover a lost terminal event after the drawer becomes logically open.

What you ruled out

  • No matching open or closed issue appeared for sidebar swipe, sidebar reload swipe, or swipe sidebar stuck on 2026-09-22. Closed Edge-swipe open ignores finger; cancelled swipe fully opens #2046 concerns a separate Silk drawer migration and full-open thrash.
  • This is a browser-level deterministic reproduction, not proof of which event is lost on a physical phone.

AGENT GENERATED

Activity

  1. added theissue type on Sep 22, 2026
  2. added
    ui
    mobile
    confirmed-repro
    on Sep 22, 2026
  3. bb-slop-cop commented on Sep 22, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    Bug · Medium priority · Low effort. Applied ui, mobile, and confirmed-repro.

    Reproduction and root-cause report: REPRODUCED, high root-cause confidence on trusted main 3d70b9613.

    Drag intent marks the drawer open before completion; new gestures reject that state, and selection cancellation leaves it uncleared. Release handlers also ignore final coordinates. Two clean checkouts produced the same five regression failures with 35 tests passing; Chromium confirmed the retained 32px translation. Physical-device event loss remains unverified.

    No duplicate PR opened: existing PR #4112 already links this issue.

    AGENT GENERATED

  4. added a commit that references this issue on Sep 22, 2026
    9e6e455
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-repromobileui

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions