Skip to content

Edge-swipe open ignores finger; cancelled swipe fully opens #2046

Closed

Description

@benwickham

Summary

On the Silk mobile sidebar migration branch, edge-swipe open still uses a custom document swipe session. On drag intent it flushSyncs setOpenMobile(true), which drives ResponsiveDrawerShell/activeDetent to fully open immediately. Finger progress (session.lastProgress) is never mapped into Silk detents during the gesture. A hesitant or cancelled swipe therefore springs the full sidebar open, then settleMobileSwipe(false) deferred-closes ~220ms later. Safe change commits open only on winning release in some paths, but full Silk detent scrubbing remains unresolved.

Versions and environment

  • Branch: bb/plan-silk-mobile-sheet-migration-thr_rbz75bfkui
  • Head at filing: see metadata block (source review may cite an earlier SHA)
  • Review artifact: /tmp/compound-engineering-1000/ce-code-review/20260820-164824-1b0b5004
  • Finding ID: #12 from synthesized residual review

Steps to reproduce

  1. Build/run the app on a compact/mobile viewport with the Silk sidebar migration.
  2. Start an edge-swipe open from the left edge.
  3. Drag only a short distance (e.g. ~20px) so open threshold is not met, then release.
  4. Observe open/close thrash: sidebar fully presents mid-gesture, then deferred-closes after settle.

Expected vs actual

Expected: Finger progress scrubs Silk travel/activeDetent (or native Silk present gesture owns the open). Cancelled/sub-threshold swipes do not fully open the sidebar.

Actual: Custom swipe sets openMobile=true on drag intent; Silk presents fully; failed settle only deferred-closes. Gesture ownership is split between document swipe code and Silk travel with no shared scrubbing contract.

Evidence

  • apps/app/src/components/ui/sidebar.tsx:1164-1167 — session.isDragging = true; flushSync(() => { setOpenMobile(true); });
  • apps/app/src/components/ui/sidebar.tsx:1140-1146 — progress computed into session.lastProgress but never applied to the Silk shell
  • apps/app/src/components/ui/sidebar.tsx:1128-1141 — settleMobileSwipe(false) only deferred setOpenMobile(false) after a failed open
  • packages/shared-ui/src/components/ui/responsive-overlay.tsx:396-401 — open=true with persistClosed immediately setActiveDetent(1) (full present, not scrubbed)

Suggested fix

Either drive Silk activeDetent/travel from the swipe session progress until release, or drop the custom open scrub path and use Silk's native present gesture only. If React state must flip early for realization, keep activeDetent scrubbed to finger progress and only commit detent 1 when shouldOpenSidebarMobileSwipe wins.

What you ruled out

  • Not fixed by commit-open-only-on-winning-release alone: residual review notes that path may avoid some thrash but full Silk detent scrubbing is still unresolved.
  • Unverified live iOS Safari repro in this filing pass; filed from ce-code-review residual handoff (adversarial reviewer, confidence 75).

Metadata

  • Severity: P1
  • Confidence: 75
  • Reviewer(s): adversarial
  • Finding ID: apps/app/src/components/ui/sidebar.tsx|1164-1170|edge-swipe-open-ignores-finger-cancelled-swipe-fully-opens
  • Source branch: bb/plan-silk-mobile-sheet-migration-thr_rbz75bfkui
  • Source review run: 20260820-164824-1b0b5004
  • Canonical plan: plans/2026-08-20-001-refactor-silk-mobile-drawers-plan.md

AGENT GENERATED: by Grok 4.5

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions