feat(web): unify selection mode across media walls (ADR 0099) #914

Merged
chris merged 4 commits from feat/unified-selection-mode into main 2026-09-27 15:09:40 +02:00
Owner

ADR 0099 implementation: uniform selection-mode semantics on every selectable MediaGrid wall

Decision points → changes

1. Click-to-toggle everywhere

  • MediaGrid.svelte:612: removed the !checkboxOnlySelection bypass — handleMediaClick now routes every short click/tap to selection toggle whenever a selection is active, on every selectable wall. With no selection, per-wall defaults (detail overlay) are unchanged, so curation openability is preserved.
  • Dropped the checkboxOnlySelection prop entirely (:57-62 contract removed; sweepAvailable gate :179 simplified; all internal uses removed).

2. Drag-sweep everywhere

  • The timeline rubber-band sweep is now standard: walls opt in by passing selectionSweep; eligibility unchanged (selection already active at pointerdown, long-press entry ends that gesture, headers/gaps/placeholders inert, touch scroll inside selection starts on non-tile points).
  • DiscoveryInstanceDetail.svelte (curation wall serving /explore/people/*, plants, etc.): dropped checkboxOnlySelection={true}, wired selectionSweep={sweepSelectedMedia} with a batched commit (:696-712 — set-union add / set-filtered remove, anchor maintained, one state update per rAF batch).
  • albums/[albumId]/+page.svelte: wired selectionSweep the same way (:137-153, :490), gated on selectionBusy.

3. People-page bug fixed
On the people/instance page, clicking another image while a selection was active opened the detail overlay instead of toggling. This was the sole checkboxOnlySelection consumer (added deliberately 2026-09-22) contradicting spec 21h; the bypass is gone and the curation wall now follows the uniform rule.

4. Out of scope (unchanged)
Album suggestion-review grid keeps its domain action semantics; the tentative-candidate list keeps explicit selection-mode semantics; checkboxes, section toggles, keyboard selection, long-press entry, alwaysShowSelectionControls all unchanged.

5. Cleanup
Deleted the dead routes/explore/people/[personRecordId]/+page.svelte (308-redirected by +page.ts since S032T006). SvelteKit builds fine with the +page.ts-only redirect route — verified.

Spec/ADR artifacts

  • specs/001-v1-baseline/ux-capability-matrix.md item 11: rescoped from "timeline opt-in" to every selectable wall incl. curation surfaces.
  • specs/001-v1-baseline/spec.json SC-21i3: same rescope, eligibility details preserved (spec-query CLI).
  • ADR 0099 flipped to accepted.

Tests

  • tests/instance-remove-mode.spec.ts: flipped the enshrined exception — with an active selection, clicking tile B now yields 2 selected with no media= param; companion assertion proves no-selection clicks still open the overlay; added touch sweep (mobile), desktop mouse sweep, and sweep-deselect cases.
  • tests/albums.spec.ts: new album-detail test — no-selection click opens overlay, click-while-selected toggles, touch + mouse sweep select, backward sweep deselects.
  • Timeline 21h/21i3 suites untouched and green.

Validation

  • npm run check: 0 errors (18 pre-existing warnings).
  • npm run build: success.
  • npx playwright test tests/timeline.spec.ts tests/instance-remove-mode.spec.ts tests/discovery-domain-selection.spec.ts tests/albums.spec.ts (desktop + Pixel 7): 152 passed, 14 skipped, 0 failed, 0 flaky.
## ADR 0099 implementation: uniform selection-mode semantics on every selectable MediaGrid wall ### Decision points → changes **1. Click-to-toggle everywhere** - `MediaGrid.svelte:612`: removed the `!checkboxOnlySelection` bypass — `handleMediaClick` now routes every short click/tap to selection toggle whenever a selection is active, on every selectable wall. With no selection, per-wall defaults (detail overlay) are unchanged, so curation openability is preserved. - Dropped the `checkboxOnlySelection` prop entirely (:57-62 contract removed; `sweepAvailable` gate :179 simplified; all internal uses removed). **2. Drag-sweep everywhere** - The timeline rubber-band sweep is now standard: walls opt in by passing `selectionSweep`; eligibility unchanged (selection already active at pointerdown, long-press entry ends that gesture, headers/gaps/placeholders inert, touch scroll inside selection starts on non-tile points). - `DiscoveryInstanceDetail.svelte` (curation wall serving /explore/people/*, plants, etc.): dropped `checkboxOnlySelection={true}`, wired `selectionSweep={sweepSelectedMedia}` with a batched commit (:696-712 — set-union add / set-filtered remove, anchor maintained, one state update per rAF batch). - `albums/[albumId]/+page.svelte`: wired `selectionSweep` the same way (:137-153, :490), gated on `selectionBusy`. **3. People-page bug fixed** On the people/instance page, clicking another image while a selection was active opened the detail overlay instead of toggling. This was the sole `checkboxOnlySelection` consumer (added deliberately 2026-09-22) contradicting spec 21h; the bypass is gone and the curation wall now follows the uniform rule. **4. Out of scope (unchanged)** Album suggestion-review grid keeps its domain action semantics; the tentative-candidate list keeps explicit selection-mode semantics; checkboxes, section toggles, keyboard selection, long-press entry, `alwaysShowSelectionControls` all unchanged. **5. Cleanup** Deleted the dead `routes/explore/people/[personRecordId]/+page.svelte` (308-redirected by +page.ts since S032T006). SvelteKit builds fine with the +page.ts-only redirect route — verified. ### Spec/ADR artifacts - `specs/001-v1-baseline/ux-capability-matrix.md` item 11: rescoped from "timeline opt-in" to every selectable wall incl. curation surfaces. - `specs/001-v1-baseline/spec.json` SC-21i3: same rescope, eligibility details preserved (spec-query CLI). - ADR 0099 flipped to `accepted`. ### Tests - `tests/instance-remove-mode.spec.ts`: flipped the enshrined exception — with an active selection, clicking tile B now yields `2 selected` with no `media=` param; companion assertion proves no-selection clicks still open the overlay; added touch sweep (mobile), desktop mouse sweep, and sweep-deselect cases. - `tests/albums.spec.ts`: new album-detail test — no-selection click opens overlay, click-while-selected toggles, touch + mouse sweep select, backward sweep deselects. - Timeline 21h/21i3 suites untouched and green. ### Validation - `npm run check`: 0 errors (18 pre-existing warnings). - `npm run build`: success. - `npx playwright test tests/timeline.spec.ts tests/instance-remove-mode.spec.ts tests/discovery-domain-selection.spec.ts tests/albums.spec.ts` (desktop + Pixel 7): **152 passed, 14 skipped, 0 failed, 0 flaky**.
docs(adr): accept ADR 0099
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 / 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 postgres image (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 4m39s
96626cd86f
chris merged commit e855d1c2cd into main 2026-09-27 15:09:40 +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!914
No description provided.