2 ADR 0099 selection mode is unified across all media walls
Forgejo Actions edited this page 2026-09-27 13:09:48 +00:00

ADR 0099: Selection mode is unified across all media walls

Status: accepted Date: 2026-09-27

Context

Memories has selection mode on several media walls, but tile-click semantics are inconsistent. Spec 001 baseline AC 21h already states the rule unqualified: once any item is selected, short-clicking/tapping additional media items toggles their selection instead of opening media detail until selection is cleared. Implementation contradicts this: MediaGrid.svelte:565 gates the click-to-toggle path behind !checkboxOnlySelection, and DiscoveryInstanceDetail.svelte:1935 is the only checkboxOnlySelection={true} consumer (added deliberately 2026-09-22, commit 20343132, so tiles stay openable for face curation). Net effect: on the people/instance page, clicking another image while a selection is active opens the detail overlay instead of toggling - a user-reported bug that the spec was never supposed to allow. Separately, drag-sweep selection (press a tile while selection is active, drag across loaded tiles; each newly touched tile is set once to the frozen select/deselect mode taken from the start tile) shipped timeline-only (PR #900) as an ADR-worthy extension of AC 21i3, with ux-capability-matrix item 11 scoping it to walls that explicitly opt in - a second inconsistency layered on the first. Consumers inventory: search/map/album-card/shared-people/discovery-media have no selection mode (click opens overlay, unaffected either way); album detail already follows 21h; the DiscoveryInstanceDetail wall (serving /explore/people/*, plants, etc.) is the sole checkboxOnlySelection consumer; the dedicated tentative-candidate list (spec 041) keeps explicit selection-mode semantics; the album suggestion review grid has its own toggle-on-click domain semantics and is not a generic selection wall. Tests currently enshrine the exception: tests/instance-remove-mode.spec.ts:233-252 asserts click opens the overlay even with an active selection.

Decision

Selection-mode interaction semantics are uniform on every selectable MediaGrid wall. (1) Click-to-toggle everywhere, spec 21h as written, no exceptions: while at least one item is selected on a wall, a short click/tap on any tile toggles that tile's selection; it never opens media detail. With no selection active, tiles keep their per-wall default behavior (usually opening the detail overlay), preserving face/occurrence curation openability on DiscoveryInstanceDetail. Checkboxes, section-title toggles, keyboard selection, and long-press entry are unchanged. (2) Drag-sweep everywhere: the rubber-band sweep is standard MediaGrid behavior on every selectable wall, not a timeline-only opt-in. Same eligibility rule as timeline: selection must already be active at pointerdown; a long-press that enters selection ends that gesture; gestures on headers/gaps/placeholders do nothing. On walls in selection mode, scrolling is done by starting the gesture on headers/gaps (touch-action on tiles while selection is active); outside selection mode native scrolling is untouched. (3) DiscoveryInstanceDetail follows the same rules; the checkboxOnlySelection bypass is removed/redefined by this ADR. (4) Out of scope: the spec 041 tentative-candidate list keeps its own explicit selection-mode semantics; album suggestion review is a domain action grid, not a generic selection wall. Alternatives considered: (a) keep per-wall semantics and fix only the instance-detail grid - rejected: leaves two mental models and reopens this debate per wall; (b) component-level bypass of checkboxOnlySelection when selectionActive - rejected: keeps a dead-ish prop whose remaining meaning is 'sometimes ignored', the worst of both; (c) unify as decided - accepted: consistency wins; curation openability is preserved by the no-selection default.

Consequences

MediaGrid drops the checkboxOnlySelection click bypass (prop removed or redefined to mean selection-entry-only); selectionSweep is wired per wall with batched state commit per consumer; ux-capability-matrix item 11 and spec.json 21i3 are rescoped from 'timeline opt-in' to all selectable walls; tests/instance-remove-mode.spec.ts:233-252 is updated to assert toggle-while-selected; the dead legacy explore/people/[personRecordId]/+page.svelte (308-redirected since S032T006) is optionally deleted as cleanup. Easier: one mental model across all walls, spec/test alignment with 21h as written, future selectable walls inherit correct behavior for free. Harder/riskier: curation surfaces lose one-click open-while-selecting - mitigation is clearing selection via the toolbar X, after which click opens the overlay again; touch scrolling inside an active selection is restricted to non-tile start points on all walls, not just timeline; one round of test churn across walls. Revisit triggers: a future wall needing genuinely different tile-click semantics should define a new interaction mode in MediaGrid, not a selection exception; UX feedback showing sweep misfiring on dense/small-tile walls may warrant per-wall opt-out; if curation workflows show heavy open-while-selecting demand, revisit with a dedicated explicit-open affordance (e.g. long-press-open) rather than restoring the bypass.