Skip to content

feat(home): picker Cancel button + drag-to-reorder slots - #60

Merged
thypon merged 1 commit into
masterfrom
feat/slot-cancel-reorder
Nov 12, 2026
Merged

thypon merged 1 commit into
masterfrom
feat/slot-cancel-reorder

Conversation

@thypon

@thypon thypon commented Nov 12, 2026

Copy link
Copy Markdown
Owner

What

1. Cancel on the app picker. The long-press slot picker ("Select app") now shows a Cancel button to the left of Add link (negative button position), consistent with the gesture pickers.

2. Drag to reorder slots. A long press on a main-view slot picks it up (haptic); moving the finger reorders it live against the neighbouring rows; releasing drops it and persists the new order into the slot preferences (<i> / p<i> rewritten for all rows).

  • Long press released without moving still opens the app picker.
  • Quick tap still launches the assigned app.
  • The usage "Last App" row is pinned and not draggable.
  • Interaction is implemented with the row's own touch stream (no ItemTouchHelper; the home screen is a plain LinearLayout).

BDD (red→green)

  • The app picker offers a cancel button — Cancel present, left of Add link, pressing it launches nothing.
  • Long-press dragging a slot reorders the apps — drag slot 0 past slot 1 → visible order and stored assignments swap.
  • A dragged slot order survives a relaunch — persistence across activity recreation.
  • All existing picker/tap scenarios stay green (long-press picker now driven by real touch events: DOWN → hold past the long-press timeout → UP).

Test infra fix

ShadowActivity records started intents for the whole feature sandbox; a scenario that launches an app made later no app was launched assertions fail. cleanScenarioState now clears the queue (clearNextStartedActivities).

Testing

./gradlew check BUILD SUCCESSFUL (unit + BDD + 80% JaCoCo gate + lint), fresh build directory.

Commits are unsigned (signing key passphrase-locked).

- The slot picker (Select app) gains a Cancel button to the left of
  Add link (negative button), consistent with the gesture pickers.
- Slots are now draggable: a long press picks the row up (haptic), moving
  the finger reorders it live against the neighbouring rows, releasing
  drops it and persists the new order into the slot preferences. A long
  press released without moving still opens the app picker, and a quick
  tap still launches the assigned app. The usage Last App row is not
  draggable.
- Test infra: the ShadowActivity started-intents queue now resets per
  scenario (a scenario that launches an app made later no-app-launched
  assertions in the same feature fail), and the slot drag helper drives
  real touch events through the long-press timeout.
@github-actions

Copy link
Copy Markdown

The following commits were not verified:
3ba7d27 (unsigned)

@thypon
thypon merged commit e650e4b into master Nov 12, 2026
5 checks passed
@thypon
thypon deleted the feat/slot-cancel-reorder branch November 12, 2026 22:04
thypon added a commit that referenced this pull request Nov 12, 2026
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.
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