feat(web): drag-select sweep in timeline selection mode #900

Merged
chris merged 8 commits from feat/drag-select-timeline into main 2026-09-27 10:54:49 +02:00
Owner

Summary

In timeline selection mode, dragging a finger (or pressed mouse) across media tiles now sweeps their selection: each newly touched loaded tile is set once to the drag's frozen mode (select or deselect, derived from the start tile's state at pointerdown). Re-crossed tiles never flip twice.

  • Opt-in via new selectionSweep(ids, mode) prop on MediaGrid; only the timeline passes it. All other walls (albums, people, discovery) keep byte-identical selection/scroll behavior.
  • Sweep eligibility frozen at pointerdown: a long-press that enters selection mode ends that gesture; the next drag sweeps. Selection stays toggleable by short tap/click.
  • rAF-batched commits (createSweepBatcher) with synchronous flush on pointerup so fast sweeps stay O(frames) state updates.
  • Separate pointerup (success: final hit-test + click suppression) vs pointercancel/lostpointercapture paths (flush observed only, no suppression) with idempotent cleanup and document-level fallback when pointer capture is unavailable.
  • Hit-testing scoped to the originating grid instance; tiles are touched only while selection was already active, so normal page scrolling outside selection mode is fully unchanged (covered by a real CDP touch-scroll regression test).

Spec

  • specs/001-v1-baseline/spec.json: new SC-21i3
  • ux-capability-matrix.md: item 11

Test plan

  • npm run check: 0 errors
  • npx playwright test tests/timeline.spec.ts: 74 passed (incl. real CDP touch sweep, re-cross, cancel lifecycle, same-contact long-press exclusion, mouse sweep, scroll regression)
  • npx playwright test tests/discovery-domain-selection.spec.ts: 26 passed
  • tests/instance-remove-mode.spec.ts (non-timeline grid): 18 passed
## Summary In timeline selection mode, dragging a finger (or pressed mouse) across media tiles now sweeps their selection: each newly touched loaded tile is set once to the drag's frozen mode (select or deselect, derived from the start tile's state at pointerdown). Re-crossed tiles never flip twice. - Opt-in via new `selectionSweep(ids, mode)` prop on MediaGrid; only the timeline passes it. All other walls (albums, people, discovery) keep byte-identical selection/scroll behavior. - Sweep eligibility frozen at pointerdown: a long-press that *enters* selection mode ends that gesture; the next drag sweeps. Selection stays toggleable by short tap/click. - rAF-batched commits (`createSweepBatcher`) with synchronous flush on pointerup so fast sweeps stay O(frames) state updates. - Separate pointerup (success: final hit-test + click suppression) vs pointercancel/lostpointercapture paths (flush observed only, no suppression) with idempotent cleanup and document-level fallback when pointer capture is unavailable. - Hit-testing scoped to the originating grid instance; tiles are touched only while selection was already active, so normal page scrolling outside selection mode is fully unchanged (covered by a real CDP touch-scroll regression test). ## Spec - `specs/001-v1-baseline/spec.json`: new SC-21i3 - `ux-capability-matrix.md`: item 11 ## Test plan - `npm run check`: 0 errors - `npx playwright test tests/timeline.spec.ts`: 74 passed (incl. real CDP touch sweep, re-cross, cancel lifecycle, same-contact long-press exclusion, mouse sweep, scroll regression) - `npx playwright test tests/discovery-domain-selection.spec.ts`: 26 passed - `tests/instance-remove-mode.spec.ts` (non-timeline grid): 18 passed
docs(web): correct selectionSweep opt-in doc comment
All checks were successful
Wiki Sync / Sync wiki from docs (push) Has been skipped
Build and Deploy / Detect changed services and test scopes (push) Successful in 3s
Build and Deploy / Android unit tests and debug APK (push) Has been skipped
Build and Deploy / Build postgres image (push) Has been skipped
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Smoke people worker (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Deploy postgres (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Successful in 3m47s
11dd4f230e
chris merged commit 4b6406cc43 into main 2026-09-27 10:54:49 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
chris/memories!900
No description provided.