Skip to content

fix(home): drag UX — long press survives drift, settle only on release - #61

Merged
thypon merged 1 commit into
masterfrom
feat/slot-drag-feel
Nov 12, 2026
Merged

thypon merged 1 commit into
masterfrom
feat/slot-drag-feel

Conversation

@thypon

@thypon thypon commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Problem (device feedback on #60)

  1. Long press stopped working. Natural micro-movements of a finger drift past the touch slop during a long hold, and the touch listener cancelled the pending long-press runnable on every such drift — the app picker became effectively unreachable.
  2. Drag-to-reorder moved definitively, one slot at a time. The drag re-parented the row (removeView/addView) at every crossing, so the row snapped to a slot and stayed there while still held, and partially dragged rows dropped on their own.

Fix

  • Long press survives drift — the pending long-press is only cancelled by UP, CANCEL or a second pointer, matching stock View long-press semantics. Drift before the timeout no longer matters; once it fires, movement starts a drag.
  • Held row follows the finger 1:1 — translationY = dy continuously, no snapping, no re-parenting while held.
  • Other rows yield organically — rows between the origin and the hover position slide out of the way with a 150 ms translation animation (instant when animations are off); stack order and backing data stay untouched during the drag.
  • Settle only on release — the row is re-parented, retagged and persisted at the hover position when the finger lifts, and the residual half-row distance animates away instead of snapping.

Testing

Two new BDD scenarios in homescreen.feature:

  • A drifting finger still opens the picker on long-press (drift past slop during hold, then release → picker opens)
  • A picked-up slot settles only when released (mid-drag: order unchanged + row tracks finger exactly; drop: order reorders and persists)

Full ./gradlew check green (Cucumber BDD + 80% coverage gate).

Commits are unsigned (signing key passphrase-locked).

Device feedback after #60: natural finger wobble past the touch slop
cancelled the pending long-press, making the picker unreachable; and the
drag re-parented the row at every slot crossing, so it moved definitively
one spot at a time and dropped mid-gesture.

The long press now fires regardless of drift (only UP, CANCEL or a second
pointer cancels it). While held, the picked row tracks the finger one to
one and the other rows slide out of the way with a 150 ms translation
animation (instant when animations are off) — the stack order and the
backing data stay untouched. Dropping settles the row at the hover
position: only then is it re-parented, retagged and persisted, with the
residual half-row distance animated away instead of snapping.

BDD: drifting-finger long-press scenario, pick-up/follows-finger/drop
scenario; new world helpers longPressSlotWithDrift, pickUpSlot, dropSlot
and pickedSlotFollowsFinger.
@github-actions

Copy link
Copy Markdown

The following commits were not verified:
6040a67 (unsigned)

@thypon
thypon merged commit 58d63f1 into master Nov 12, 2026
5 checks passed
@thypon
thypon deleted the feat/slot-drag-feel branch November 12, 2026 23:39
@thypon

thypon commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Follow-up commit 3a9acd8 reworks the drag to reorder live:

  • The held row is never removed from its parent — that detach was what killed the touch stream and auto-dropped the drag after one swap. The crossed neighbour is re-parented around the held row instead, animating into its new place (150ms, instant when animations are off).
  • The held row tracks the finger 1:1 the whole time and only settles on release.
  • The reorder threshold is measured from the slot-grid origin (the stack is gravity-centered), so one swap per crossed slot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant