-
Notifications
You must be signed in to change notification settings - Fork 83
Add object type filtering to Social Web feed sidebar #2534
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
Merged
Merged
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
- Create useObjectTypeFilter hook to manage ap_object_type filters - Add ObjectTypes component to display taxonomy terms in sidebar - Integrate ObjectTypes under Feed menu item using MenuItem design - Add postList icon to Feed menu item - Add icons for each object type (article, audio, document, event, etc.) - Add default icon (post) for unmapped types - Enable toggle filtering by clicking object type names - Fix selection highlight by manually adding is-selected class - Use simple margin-right (8px) for icon spacing matching Gutenberg - Use same translated names as built-in object type field - Follow same pattern as tag filtering using view.filters
- Keep object type field filter operator as 'is' (not 'isAny') - Update hook to use single number value instead of array - Update useFeed hook to wrap single values in array for REST API compatibility - Update icon sizes from 20 to 24 for both Feed menu item and object types - This fixes the issue where the "Type" filter button in DataViews toolbar doesn't properly display the selected object type name
Copilot finished reviewing on behalf of
pfefferle
November 25, 2025 09:47
Integrate with popular tags feature from PR #2512
- Replace isSelected prop with aria-pressed attribute following WordPress accessibility patterns - Remove manual .is-selected class addition - Add loading state with proper wrapper div and message - Update CSS to handle aria-pressed='true' for selection state - Add styling for loading state with BEM naming
- Remove default focus box-shadow and outline - Add focus-visible for keyboard navigation only - Use !important to override MenuItem default styles - Keep background consistent on active/hover for selected items - Matches WordPress core behavior
… on click - Created useFeedFilters hook to detect active filters and clear all filters - Feed menu item now shows as selected when no filters are active - Clicking Feed clears all active filters (object type and tag filters) - Disabled transitions on menu items to prevent glow/blinking effects - Added !important to all focus/hover/active states for consistent behavior
160b0a4 to
ae8bda2
Compare
The field definition was using default WordPress query parameters which limited results to 10 items. Now uses the same parameters as the sidebar component (per_page: -1, orderby: count, order: desc, hide_empty: true) to ensure all object types appear in the filter dropdown.
Filter sidebar to only display object types that have translations (Article, Audio, Document, Event, Image, Note, Page, Place, Video). Unknown types like Collection, Question, Activity, and Offer will still appear in the filter dropdown but not in the sidebar navigation.
Member
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
obenland
reviewed
Nov 25, 2025
Member
obenland
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
The object types menu now displays types in the order defined by the translations object, rather than by count or default taxonomy order. Unused icons and parameters were removed for clarity.
Moved object type label and icon mapping to a shared module and updated usage in feed-stage and object-type components. This improves maintainability and consistency for object type display throughout the social web UI.
Copilot finished reviewing on behalf of
pfefferle
November 25, 2025 15:45
obenland
approved these changes
Nov 25, 2025
Resolves build file conflicts by regenerating after source merge. Includes changes from add/reader: - Content field improvements - Object type context - Test cleanup changes - Updated hashtag handling in Posts collection
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[Feature] Collections
[Feature] REST API
[Feature] WP Admin
[Focus] Editor
Changes to the ActivityPub experience in the block editor
[Tests] Includes Tests
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.
Summary
Adds object type filtering functionality to the Social Web feed sidebar, allowing users to filter feed posts by ActivityPub object types (Articles, Notes, Videos, etc.).
(the list should normally way smaller and shows only the known types that were imported at least once)
Changes
ObjectTypescomponent that displays taxonomy terms as clickable filter itemsuseObjectTypeFilterhook to manage filter state using DataViewsImplementation Details
ap_object_typetaxonomyTest Plan
Fixes #2510