Skip to content

Conversation

@thunderxx2
Copy link
Contributor

Summary

This PR implements a new user preference to filter out posts containing media attachments from the timeline, as requested in issue #2382.

Changes

  • Env: Added hidePostsWithMedia to UserPreferences using @AppStorage for persistent state management.
  • Settings: Integrated a new Toggle in ContentSettingsView.swift allowing users to enable/disable media filtering.
  • Timeline:
    • Implemented filtering logic in TimelineDatasource.swift to exclude media-heavy posts during new status fetches.
    • Updated TimelineListView.swift to reactively filter the current display list, ensuring posts disappear/reappear instantly when the setting is toggled.
  • Localization: Added settings.content.media.hide-posts-with-media to Localizable.xcstrings with 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

Settings Toggle Filtered Timeline
Settings Toggle #2383_screenshot

Testing Performed

  • Verified that the toggle state persists after app restart.
  • Confirmed that posts with images/video are removed instantly when the toggle is enabled.
  • Verified that new incoming posts are filtered correctly while the setting is active.
  • Tested on iPhone 16 Simulator (iOS 18).

Closes #2382

@thunderxx2 thunderxx2 force-pushed the feat/hide-media-posts-v2 branch from 827648b to ffb2759 Compare December 29, 2025 21:07
@Dimillian
Copy link
Owner

image Hmmm ? I think you need to do localization as part of another PR and be careful not to break or change the file formatting

@thunderxx2
Copy link
Contributor Author

thunderxx2 commented Jan 2, 2026

image Hmmm ? I think you need to do localization as part of another PR and be careful not to break or change the file formatting

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!

case .status(let status):
if shouldShowStatus(status, filter: snapshot) {
filtered.append(item)
if !hideMedia || status.mediaAttachments.isEmpty {
Copy link
Owner

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

Copy link
Contributor Author

@thunderxx2 thunderxx2 Jan 5, 2026

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.angled SF 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!

@thunderxx2 thunderxx2 force-pushed the feat/hide-media-posts-v2 branch from 71724b1 to 263ff38 Compare January 5, 2026 21:18
@Dimillian Dimillian merged commit bf95981 into Dimillian:main Jan 6, 2026
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.

Feature request: Toggle to hide posts containing any sort of media

2 participants