Skip to content

fix(mobile): start sheet drags from the grabber and header - #428

Merged
nixuuu merged 1 commit into
devfrom
fix/mobile-sheet-drag
Nov 9, 2026
Merged

nixuuu merged 1 commit into
devfrom
fix/mobile-sheet-drag

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 9, 2026

Copy link
Copy Markdown
Member

Dragging from a sheet's grabber or noninteractive header did nothing after #425, while dragging Updates' refresh button could close it. Shared chrome only requested the responder on movement; it never explicitly claimed the initial touch. The handle was also only 28 dp tall.

This change requests touch start in the bubbling phase on the shared native drag-area View. A descendant Pressable gets first refusal, so header buttons retain normal taps. Move capture takes over only for one finger moving more than 6 dp vertically, with vertical travel greater than horizontal travel. The grabber now occupies a full-width, 44 dp zone with the visible pill centered and excluded from hit testing.

Acquiring the responder alone does not start a drag. Position work and keyboard dismissal wait for deliberate vertical movement; a tap or horizontal movement on plain chrome leaves both alone. The responder factory remembers whether acquisition happened through move capture because RN resets dy on grant. Existing gesture math, springs, exit lifecycle, backdrop tracking, keyboard-first dismissal and accessibility actions are preserved.

Fixes: #425

Scope and responder review

  • Shared SheetDragArea forwards handlers directly to a native View. SheetSurface, PickerSheet, Updates and every other marked header inherit the fix without per-screen handlers. The grabber uses the same path. No gesture handlers were added to scrollable content.
  • Inspected the shared surfaces, all grabber/header wiring and feat(mobile): drag sheets to close with position-only motion #425's description/diff. The viewport's pointerEvents="box-none" leaves children interactive; the sheet extension is below the surface and has pointerEvents="none". The existing translucent Android Modal and safe-area layout remain unchanged.
  • Reviewed RN responder bubbling/capture, PanResponder lifecycle, and installed RN 0.88.1's PanResponder.js and Fabric responder implementation. RN supports move negotiation without an existing responder, so the refresh-button symptom is consistent with missing initial acquisition on native chrome, rather than proof that move negotiation always requires a child responder. Physical-device reproduction was unavailable.
  • JS/TS implementation only; no dependencies, native modules, assets, app config or runtime policy changed. Updated the existing Polish mobile documentation. No UI copy changed; copy audit is not applicable.

Validation

  • bun install --frozen-lockfile and bun run gen:check passed.
  • bun test tests/integration/mobile-sheet-gesture.test.ts: 5 passed, 0 failed, 51 assertions. Pure decision coverage includes initial chrome acquisition, control/content exclusion, taps/jitter, vertical direction and dominance, configurable threshold and multiple fingers; existing distance/fling/rubber-band/re-grab coverage also passes.
  • bun run typecheck, bun run lint and bun run format:check passed. Expo ESLint passed for all three changed mobile source files.
  • bun run --filter @canopy/web build passed.
  • No full local check:tmp, UI tests, device/simulator runs, native builds or OTA publication. CI is the full-suite gate; the device checks below remain unperformed.

OTA fingerprint comparison

Generated on clean current dev (04a871be3b18c4abf15910ec31d0071e69795d73) before editing and on the final implementation, from apps/mobile, for both platforms:

bunx [email protected] fingerprint:generate --platform ios --build-profile production --json --non-interactive
bunx [email protected] fingerprint:generate --platform android --build-profile production --json --non-interactive
Platform Current dev This change
iOS bf3156a1bd878e10c0b0be25d4c194a837fb1b7e bf3156a1bd878e10c0b0be25d4c194a837fb1b7e
Android d638e5f7b7fa87f54ccc0715c5fe150b8c0ad3ae d638e5f7b7fa87f54ccc0715c5fe150b8c0ad3ae

Both runtime fingerprints are unchanged from current dev, including #424's baseline changes. This supports OTA compatibility with that runtime.

Manual checks required on iOS and Android

Run the interaction checks for each applicable sheet in this matrix, separately on iOS and Android. Include light/dark, a phone and a wide window, and short/typical/long titles. These are instructions, not claimed results.

Sheet family Coverage
Choice pickers Model, effort, project, worker, provider/profile and permission choices
Action menus Thread actions, queued-message actions, attachment menu and text actions
System sheets Updates, connection details and gateway-update details
Forms Goal, side thread, queued-message editor, thread secrets, search, quote editor and settings inputs
Full details Thread, bot and other details/settings presented through SheetSurface/Sheet
Interaction Steps and expected result
Grabber Start on the pill, then in the blank area near either side of its full-width 44 dp zone. Drag slowly down. Each start must move the sheet; a stationary tap must not start a drag.
Header empty area Start on title text and on blank space in the header row, away from controls. Move vertically beyond 6 dp. The sheet must follow; horizontal movement and movement of 6 dp or less must not begin a drag.
Header button drag In Updates, start on Check now, then drag down beyond 6 dp with vertical dominance. Repeat on a header close/action button in a full sheet. The sheet must take over and the button action must not fire on release. Disabled header controls must not create dead drag zones.
Header button tap Tap Check now or another enabled header action without dragging. Its action must run once, with no sheet movement. Repeat with small finger jitter. Tapping Close must use the normal exit exactly once.
Keyboard open In a searchable model picker and an editable form, focus the input and type. A tap on plain chrome must leave the keyboard alone. The first vertical drag must dismiss only the keyboard and keep the sheet still for the rest of that touch; release, then drag again to move/dismiss the sheet. Verify the draft remains intact.
Motion/lifecycle Steps and expected result
Distance and fling Without the keyboard, release a slow drag below 28% of sheet height: spring back. Release beyond 28%: dismiss. Fling down after at least 8 dp at roughly 900 dp/s or faster: dismiss even below 28%. Once active, slow downward travel must follow 1:1 and the backdrop must track position.
Reversal and interruption Drag up: bounded rubber-band resistance. Reverse sharply upward before release: cancel dismissal. Re-grab during spring-back: no position jump. Interrupt a gesture with OS controls or Android back: no stuck sheet or stale gesture overwriting an exit.
Reduced motion and accessibility Enable reduced motion: automatic slides/springs become instant while dragging still works. With VoiceOver/TalkBack, invoke the grabber's Close action and verify dismissal; check accessibility escape where available.
Scroll and native Modal Scroll content at the top and midway: native scrolling must remain independent. Open/close repeatedly and rotate/fold: no blocked hit areas, safe-area offsets or transparent seams. On Android verify backdrop tap and back dismissal.

Claim noninteractive chrome on touch start while preserving header button taps and thresholded move capture. Enlarge the grabber to a full-width 44 dp touch zone and cover responder decisions with focused tests.

Fixes: #425
@nixuuu
nixuuu merged commit 119b373 into dev Nov 9, 2026
15 of 17 checks passed
@nixuuu
nixuuu deleted the fix/mobile-sheet-drag branch November 9, 2026 17:58
nixuuu added a commit that referenced this pull request Nov 9, 2026
Bot composer text was held by the mounted component, so leaving Bots
could discard the message. Bot drafts now live in the owner's gateway
database and restore on web, desktop and mobile. Bot chats also accept
images and deliver them to the official worker harness.

- Persist text, structured mentions, quotes/comments and uploaded image
metadata with revision checks. Keep pending uploads through navigation,
preserve failed sends and their request IDs, and clear only the
acknowledged draft revision.
- Reuse attachment uploads, configured file/count/message limits,
thumbnails and viewers. Web/desktop support paste, drop and Attach
images; mobile uses the existing paste/photos/files intake. This scope
supports PNG, JPEG, GIF and WebP only; other file types can follow.
- Deliver verified, normalized images as native Claude SDK, Codex
app-server and Grok ACP image parts. Bots gain no filesystem tools.
Resumed sessions receive current images; rebuilt sessions also receive
bounded historical images, with a note for omissions. Preserve #429's
Canopy MCP approval override on Codex start/resume, Grok MCP allow rule,
actionable failures and shared approval labels; gateway authorization
remains authoritative.
- Add `bot_images_v1` and `remote_bot_composer_v1` capability gates.
Linked draft/upload/send operations remain owner-scoped. Moving a bot
preserves its draft, images and thumbnails; an older destination is
refused before cut-over.
- Add migration `0102_bot_composer` (latest dev migration was 0101 when
opening this PR), additive RPC/fields and generated contracts. Polish
docs cover persistence, native delivery, schema and mobile behavior.

Validation: `bun install --frozen-lockfile`, `bun run typecheck`, `bun
run lint`, `bun run format:check`, `bun run gen:check` and `bun run
--filter @canopy/web build` passed.

Focused tests rerun on dev ecb20e4 (#429): 52 passed across
bot-composer, bots-harness-context, bots-harness-approvals, worker
isolation/Grok transcript and DB schema (282 assertions). The official
Codex MCP approval regression also passed (4 assertions). The bot
computer-move case was previously verified during implementation (20
assertions). Coverage includes restart durability, structured draft CAS
and lost acknowledgements, send idempotency, owner scoping,
MIME/size/count limits, active-turn blob authorization, all three native
image adapters, resume/rebuild and historical image limits. The move
case also exercises draft/upload/send through a linked computer.

Manual browser check used an isolated gateway with the fake Codex
harness: Threads/Bots navigation, full reload, picker, clipboard/drop
events, dropping on an existing chip, uploaded draft restoration,
send/clear, message thumbnails and viewer. The harness recorded five
native image parts across two sends. Checked light/dark at desktop and
phone widths, including long filenames; no console errors. No UI tests
were added. Native device UI and live provider accounts were not
exercised.

Mobile changes are JS/TS only. Both `bunx [email protected]
fingerprint:generate --platform <ios|android> --build-profile production
--json --non-interactive` results match current dev (ecb20e4, including
#427/#428/#429):
- iOS: `6ddec9ef559ee0095ac33e94ff9418a942053b17`
- Android: `5f6eae3ab278f1cd543e9ed763f923a319b65ec9`

Full `check:tmp` was intentionally left to CI as requested for the
shared machine. An upload still in progress when the application closes
must be added again; completed uploads are durable.

Copy audit (§8): “Attachments are coming soon” → “Attach images” for the
implemented action; new “Drop images to attach” describes the supported
intake; “Load saved draft” names the recovery result. Conflict copy
tells the user to copy edits before loading the saved version;
upload/send errors explain recovery. Labels use English sentence case
and action verbs, existing attachment terms and limits are reused, and
controls have text/accessibility labels independent of icons or colour.
No new empty states or decorative sentences. Short, typical and long
filenames were checked at desktop and phone widths.

Related: #398, #421
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.

1 participant