-
-
Notifications
You must be signed in to change notification settings - Fork 679
feat: add preference to hide posts containing media (#2382) #2400
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
Conversation
827648b to
ffb2759
Compare
ffb2759 to
9e6a69e
Compare
Hi @Dimillian , I've moved the localization to a separate PR here: [/pull/2406]. This PR is now strictly focused on the filtering logic. Ready for review! |
9e6a69e to
01e3783
Compare
| case .status(let status): | ||
| if shouldShowStatus(status, filter: snapshot) { | ||
| filtered.append(item) | ||
| if !hideMedia || status.mediaAttachments.isEmpty { |
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.
This should be directly in the shouldShowStatus function
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.
Hi @Dimillian, thanks for the feedback! I've refactored the PR to align with your suggestions and improved the UI layout:
- Logic Refactor: Moved the media filtering check directly into the shoudShowStatus function
- Architecture & Decoupling: Removed the UserPreferences dependency from the view. I've now placed the preference into TimelineContentFilter and included it in the Snapshot.
- UI Polish: Moved the toggle to 'Content Filter' section in Settings for better grouping
- Iconography: Added the
photo.on.rectangle.angledSF symbol to match the existing list style and ensure compatibility across iOS versions - Localization: Updated the key to timeline.filter.hide-posts-with-media for better consistency.
Let me know if this looks better!
71724b1 to
263ff38
Compare


Summary
This PR implements a new user preference to filter out posts containing media attachments from the timeline, as requested in issue #2382.
Changes
hidePostsWithMediatoUserPreferencesusing@AppStoragefor persistent state management.ContentSettingsView.swiftallowing users to enable/disable media filtering.TimelineDatasource.swiftto exclude media-heavy posts during new status fetches.TimelineListView.swiftto reactively filter the current display list, ensuring posts disappear/reappear instantly when the setting is toggled.settings.content.media.hide-posts-with-mediatoLocalizable.xcstringswith support for multiple English locales (en, en-GB, ca).Impact
Users who prefer a text-only or low-bandwidth experience can now hide all media-based posts across their timelines.
Screenshots / Video
Testing Performed
Closes #2382