-
Notifications
You must be signed in to change notification settings - Fork 8
Add policy-filtered works, search, and facets to admin suppressed feed (PP-3525) #2990
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jonathangreen
wants to merge
11
commits into
main
Choose a base branch
from
feature/suppressed-feed-improvements
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2990 +/- ##
==========================================
+ Coverage 92.93% 92.94% +0.01%
==========================================
Files 453 453
Lines 42957 43120 +163
Branches 5989 6014 +25
==========================================
+ Hits 39923 40079 +156
- Misses 1966 1968 +2
- Partials 1068 1073 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Base automatically changed from
bugfix/remove-load-work-filter-check
to
chore/rename-admin-feed-to-suppressed
January 16, 2026 18:52
Base automatically changed from
chore/rename-admin-feed-to-suppressed
to
main
January 16, 2026 19:01
Enhance the admin suppressed feed with: 1. Policy-filtered works: Works hidden by library content filtering (audience/genre) now appear in the suppressed feed alongside manually suppressed works. Each work shows its visibility status category. 2. Search functionality: Add /admin/suppressed/search endpoint with OpenSearch support for searching within hidden works. Includes SuppressedWorkFilter that inverts normal filter behavior. 3. Visibility facets: Add facet links to filter by visibility status: - All: shows all hidden works (default) - Manually Hidden: shows only manually suppressed works - Policy Filtered: shows only works filtered by audience/genre Policy-filtered works don't get suppress/unsuppress links since they are controlled by library settings rather than manual suppression.
- Add detailed docstring to FacetGroup dataclass - Document SuppressedWorkFilter's intentional use of subset of Filter properties - Add route test for suppressed_search endpoint
Add tests to TestAdminSuppressedFeed that use the actual search index to verify SuppressedWorkFilter correctly matches: - Manually suppressed works - Audience-filtered works (library policy) - Genre-filtered works (library policy) - Empty results when no suppressed works match - Collection scoping to library's collections - Navigation links in search results
Test the FeedController.suppressed_search method: - Returns OpenSearch description document when no query provided - Returns OPDS feed with search results when query provided - Requires librarian authorization - Returns empty feed when no results match
Test that pagination links are correctly generated: - 'next' link appears when there might be more results - 'first' and 'previous' links appear on later pages
End-to-end tests for pagination links: - 'next' link when there might be more results - 'first' and 'previous' links on later pages Controller tests for error cases: - Invalid pagination parameters return ProblemDetail - Missing search engine configuration returns ProblemDetail
ee7c630 to
59b38cf
Compare
- Add helper methods to reduce code duplication: - links_for_rel: filter links by rel attribute - visibility_categories: extract visibility status categories - suppressed_search: execute search with common parameters - Merge test_suppressed_feed_includes_facet_links and test_suppressed_feed_facet_links_reflect_current_filter into single test - Parametrize query filter tests (all, manually-suppressed, policy-filtered) - Update search tests to use the new suppressed_search helper
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Enhance the admin suppressed feed with:
Policy-filtered works: Works hidden by library content filtering (audience/genre) now appear in the suppressed feed alongside manually suppressed works. Each work shows its visibility status as a category.
Search functionality: Add
/admin/suppressed/searchendpoint with OpenSearch support for searching within hidden works. IncludesSuppressedWorkFilterthat inverts normal filter behavior to match only suppressed/filtered works.Visibility facets: Add facet links to filter by visibility status:
Policy-filtered works don't get suppress/unsuppress links since they are controlled by library settings rather than manual suppression.
With these changes, the feed looks like this in the Admin UI:

Motivation and Context
Admins need visibility into all hidden works, not just manually suppressed ones. This allows them to see which works are being filtered by library policy and search within the hidden works when there are many.
Implements PP-3525.
How Has This Been Tested?
Checklist