feat(api,web): search filter for tentative vs approved face assignments #1108
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/search-approval-filter"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds an
approvalsearch filter (token + URL param + dropdown) that narrows results by face-assignment approval status:approval:tentative→ media with at least one open tentative face assignment (class_instance_occurrences.state = 'tentative', people/person, face_annotation)approval:approved→ media with at least one accepted assignment (state = 'accepted'), regardless of other pending onespending/acceptedaccepted and normalized; malformed values stay literal free text; duplicate token → 400 (likeyear:/favorite:)class_instance_occurrences→discovery_resultsjoin identical to theperson:filter; applies to all search legs including filter-only browsingTest plan
SearchQueryParserTest/SearchServiceTest(tentative/approved/both/neither fixtures, aliases, malformed, duplicate, param merge) — green after rebase on latest mainqueryTokens.spec.ts(new),searchMediaFilters.spec.ts(new), 85 unit tests green, svelte-check 0 errorssearch-filters.spec.ts(36 passed) +filter-sort.spec.ts(9 passed, shared-menu regression)Version bump 1.21.75 → 1.21.76 + changelog.
Adds an approval: query token and matching approval= request param to GET /api/search: tentative matches media with at least one open tentative face assignment (class_instance_occurrences.state = 'tentative', spec 048 — the plan's 'pending' value does not exist on occurrences), approved matches at least one user-confirmed assignment ('accepted'), regardless of other pending faces. Aliases pending/ accepted normalize; malformed values stay literal free text and a duplicate token is a 400, mirroring the favorite: token. The token appears in the filter summary (kind "approval") and wins over the param in mergeFilters.Adds the approval token key to the query grammar (tentative/pending/ approved/accepted, case-insensitive; malformed values stay free text), the approval param on searchMedia, an opt-in Face approval select in the shared FilterSortMenu (rendered only when the search page passes options +label, so other surfaces are unchanged), the Approval chip ("Approval: Tentative|Approved"), badge counting and chip-removal focus. Unit specs cover token parse/format/replace and the request param; e2e coverage extends tests/search-filters.spec.ts with dropdown interaction and alias deep-link sync.