feat(web): stash away / disband split action for people cluster suggestions (spec 039) #767

Merged
chris merged 1 commit from feat/stash-disband-web into main 2026-09-19 12:58:05 +02:00
Owner

Implements spec 039 Task T002 (frontend lane).

Changes

apps/web/src/lib/api/discovery.ts

  • ClassInstanceCandidateDecisionRequest.decision and ClassInstanceCandidateDecisionResult.state extended to 'accepted' | 'rejected' | 'stashed' | 'disbanded'
  • ClassInstanceView.stashed?: boolean | null (optional, defensive against older API)
  • New stashClassInstance / unstashClassInstance / disbandClassInstance (POST .../stash, .../unstash, .../disband)
  • getDomainClassInstances(domainKey, query?, opts?) sets stashed=true search param when opts.stashed

apps/web/src/lib/components/StashDisbandSplit.svelte (new)

  • Split control: primary Stash away + chevron menu (Disband danger item, legacy Reject)
  • Menu opens upward (card bottoms / dialog footer); outside-click closes via svelte:document
  • Escape closes menu only: native (non-delegated) keydown listener via Svelte action so stopPropagation wins over the suggestion dialog's own Escape handler (Svelte 5 delegated handlers run too late)

apps/web/src/lib/components/DomainSuggestionsCarousel.svelte

  • stashCandidate / disbandCandidate handlers mirroring rejectCandidate (same details payload, decision stashed/disbanded)
  • isPeopleCluster helper: split button only on people new-person-cluster cards in create-person mode; cluster_person_match and existing_person_match keep plain Reject
  • Wired on two surfaces: detail dialog action grid (replaces whole grid for new-person clusters, adds helper line) and non-cluster card grid (compact, Accept kept beside it); cluster-match card vertical stack unchanged
  • candidate-accept / candidate-reject testids preserved (Reject now lives on the dropdown item)

apps/web/src/lib/components/DiscoveryDomainInstances.svelte (people domain)

  • Main grid fetches filter out stashed instances (flag-based, defensive)
  • Collapsed Stashed (N) section (people only): expandable, hint line, per-item Curate / Unstash / Disband with busy guard
  • Curate reuses the existing rename dialog (dialogs get combined [...instances, ...stashed] prop); naming a stashed person unstashes it into the grid ('Name saved. The person is back in your people.')
  • Unstash/Disband optimistic updates with opError + refetch on failure; Disband behind a globalThis.confirm
  • Stashed fetch skipped while a search query is active (not query-filtered; keeps search request last on the wire)

Tests

  • discovery-review.spec.ts: dialog reject tests for new_person_cluster now open the chevron menu (plus Escape-closes-menu-only assertion); 2 new tests (card stash posts stashed and removes card; menu Disband posts disbanded / Reject posts rejected)
  • discovery-stashed-people.spec.ts (new): hidden-from-grid, collapsed section + count, Curate→rename→PATCH→into grid, Unstash→POST→into grid, Disband→confirm→POST→removed
  • cluster_person_match card reject test intentionally unchanged (plain Reject still applies)

Validation

  • npm run check: 0 errors (20 pre-existing warnings)
  • Playwright (local preview): full suite 412 passed / 12 skipped, incl. all discovery specs on desktop + mobile
Implements spec 039 Task T002 (frontend lane). ## Changes **apps/web/src/lib/api/discovery.ts** - `ClassInstanceCandidateDecisionRequest.decision` and `ClassInstanceCandidateDecisionResult.state` extended to `'accepted' | 'rejected' | 'stashed' | 'disbanded'` - `ClassInstanceView.stashed?: boolean | null` (optional, defensive against older API) - New `stashClassInstance` / `unstashClassInstance` / `disbandClassInstance` (POST .../stash, .../unstash, .../disband) - `getDomainClassInstances(domainKey, query?, opts?)` sets `stashed=true` search param when `opts.stashed` **apps/web/src/lib/components/StashDisbandSplit.svelte** (new) - Split control: primary **Stash away** + chevron menu (**Disband** danger item, legacy **Reject**) - Menu opens upward (card bottoms / dialog footer); outside-click closes via `svelte:document` - Escape closes menu only: native (non-delegated) keydown listener via Svelte action so `stopPropagation` wins over the suggestion dialog's own Escape handler (Svelte 5 delegated handlers run too late) **apps/web/src/lib/components/DomainSuggestionsCarousel.svelte** - `stashCandidate` / `disbandCandidate` handlers mirroring `rejectCandidate` (same details payload, decision `stashed`/`disbanded`) - `isPeopleCluster` helper: split button only on people new-person-cluster cards in create-person mode; `cluster_person_match` and `existing_person_match` keep plain Reject - Wired on two surfaces: detail dialog action grid (replaces whole grid for new-person clusters, adds helper line) and non-cluster card grid (compact, Accept kept beside it); cluster-match card vertical stack unchanged - `candidate-accept` / `candidate-reject` testids preserved (Reject now lives on the dropdown item) **apps/web/src/lib/components/DiscoveryDomainInstances.svelte** (people domain) - Main grid fetches filter out stashed instances (flag-based, defensive) - Collapsed **Stashed (N)** section (people only): expandable, hint line, per-item Curate / Unstash / Disband with busy guard - Curate reuses the existing rename dialog (dialogs get combined `[...instances, ...stashed]` prop); naming a stashed person unstashes it into the grid ('Name saved. The person is back in your people.') - Unstash/Disband optimistic updates with `opError` + refetch on failure; Disband behind a `globalThis.confirm` - Stashed fetch skipped while a search query is active (not query-filtered; keeps search request last on the wire) ## Tests - discovery-review.spec.ts: dialog reject tests for new_person_cluster now open the chevron menu (plus Escape-closes-menu-only assertion); 2 new tests (card stash posts `stashed` and removes card; menu Disband posts `disbanded` / Reject posts `rejected`) - discovery-stashed-people.spec.ts (new): hidden-from-grid, collapsed section + count, Curate→rename→PATCH→into grid, Unstash→POST→into grid, Disband→confirm→POST→removed - cluster_person_match card reject test intentionally unchanged (plain Reject still applies) ## Validation - `npm run check`: 0 errors (20 pre-existing warnings) - Playwright (local preview): full suite 412 passed / 12 skipped, incl. all discovery specs on desktop + mobile
feat(web): stash away / disband split action for people cluster suggestions (spec 039)
All checks were successful
Build and Deploy / Detect changed services and test scopes (push) Successful in 3s
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build converter worker 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 / 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 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 1m45s
70826d5749
chris merged commit 25a0470279 into main 2026-09-19 12:58:05 +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!767
No description provided.