Skip to content

Filter media and groups by favorite state - #506

Merged
MinasukiHikimuna merged 1 commit into
mainfrom
signed/issue-430
Aug 28, 2026
Merged

Filter media and groups by favorite state#506
MinasukiHikimuna merged 1 commit into
mainfrom
signed/issue-430

Conversation

@MinasukiHikimuna

@MinasukiHikimuna MinasukiHikimuna commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add a consistent Favorite criterion to video, image, audio, text, gallery, and group list filters. The criterion filters against the signed-in user's affinity state, composes with existing criteria, renders the standard applied-filter chip, and is preserved by saved filters.

Favorite: No includes both explicit non-favorites and entities without an affinity row. The same behavior is used by normal list and aggregate queries, with matching support in filter-backed dynamic audio and text groups.

Linked issue

Closes #430

Type of change

  • Bug fix
  • New feature
  • Refactor / tech debt
  • Docs
  • Other: N/A

AI usage

  • No AI was used for this PR.
  • AI was used for this PR.
    • Model(s): GPT-5.6 Sol
    • Where / how: Issue investigation, live UI reproduction, implementation, regression tests, verification, and independent code review.
  • A human (me) has reviewed, understands, and takes full responsibility for every change here including that the design and architecture are sound. (required)

Testing done & evidence

  • Confirmed before the change that supported media and group lists did not expose their own Favorite criterion, while an existing entity filter demonstrated the expected boolean editor and applied-chip behavior.
  • Added backend behavior probes for all six entity types. The regression-first run failed the six new positive probes as expected; after implementation, the focused harness completed successfully with 60/60 tests passing, including Favorite: No behavior for entities without affinity rows:
    • dotnet test src/Cove.Tests/Cove.Tests.csproj --configuration Release --no-build --no-restore --filter "FullyQualifiedName~Cove.Tests.EntityListSortBehaviorHarnessTests.RepresentativeFiltersMatchSeededFixtureSet" --logger "console;verbosity=normal"
  • Built the affected test project in Release successfully with 0 errors:
    • dotnet build src/Cove.Tests/Cove.Tests.csproj --configuration Release --no-restore
  • Passed the required solution-wide Release build with 0 errors and four existing xUnit analyzer warnings:
    • dotnet build src/Cove.slnx -c Release --no-restore
  • Passed frontend filter-definition coverage with 19/19 tests:
    • npm test -- --run src/test/filterCriteriaDefinitions.test.ts
  • Passed filter-dialog and saved-filter coverage with 79/79 tests:
    • npm test -- --run src/test/FilterDialog.test.tsx src/test/SavedFilterMenu.test.tsx
  • Passed the focused saved-filter persistence test file with 9/9 tests after updating it to serialize favoriteCriterion:
    • npm test -- --run src/test/SavedFilterMenu.test.tsx
  • Completed the production frontend build successfully:
    • npm run build
  • Restarted the development API and verified through the live UI that Favorite is available alongside the existing criteria, applying Favorite: Yes sends a successful filtered-list request, reduces the list to the matching result, and renders an applied Favorite: Yes chip.
  • An independent xhigh code review found no blocking correctness, regression, test, or complexity issues.

Checklist

  • I have read and followed the Contribution Guide.
  • Builds and existing tests pass.
  • I added or updated tests where it makes sense.
  • I updated docs where needed.
  • This PR is focused and does not bundle unrelated changes.

Media and group lists did not expose their per-user favorite state as a composable criterion, so users could not build or save focused favorite views even though the entities supported favorites.

Add a shared affinity-backed boolean predicate to all six API filter models and list paths, expose a consistent Favorite criterion in the UI, preserve it through saved filters, and cover positive, negative, and cross-entity behavior with backend and frontend regression tests.
@MinasukiHikimuna
MinasukiHikimuna merged commit 4691a36 into main Aug 28, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add favorite filtering to media and group lists

1 participant