Skip to content

WIP: Add notification preferences and improve filtering#1775

Open
rabble wants to merge 26 commits intomainfrom
thread-muting
Open

WIP: Add notification preferences and improve filtering#1775
rabble wants to merge 26 commits intomainfrom
thread-muting

Conversation

@rabble
Copy link
Copy Markdown
Contributor

@rabble rabble commented Apr 6, 2025

Summary

  • Added notification preference settings to control who can send notifications (Anyone, People I Follow, My Network)
  • Added clarifying text 'Including people outside your network' for the 'Anyone' option
  • Fixed notification filtering to respect user preferences
  • Added thread replies toggle for notifications
  • Improved debugging for notification filtering issues
  • Fixed localization format specifiers

Test plan

  • Check that notification settings show the new preferences
  • Verify that notification filtering works correctly based on selected preference
  • Test that the 'Anyone' preference is the default
  • Ensure notifications are only received based on selected preference

Screenshot 2025-04-06 at 8 24 02 PM

rabble and others added 26 commits April 5, 2025 15:19
- Add ability to filter notifications to only show explicit mentions
- Create new section in Settings for notification preferences
- Add helper function to detect explicit mentions in note content
- Add unit tests to verify functionality

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Move notification preference UI to a separate view component
- Create NotificationPreferenceView to isolate compiler complexity
- Fix type-checking error by breaking up the expression

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Make NotificationPreference conform to NosSegmentedPickerItem protocol
- Update NosSegmentedPicker usage in NotificationPreferenceView
- Add import SwiftUI to fix LocalizedStringKey reference
- Add localization strings for new features

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add more filtering options: fromFollowsOnly, friendsOfFriends
- Add muting of notifications from muted authors
- Improve UI with a more intuitive selector layout (replacing segmented control)
- Show description text for each option
- Update localization strings
- Use SF Symbols that better represent each option

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Replace non-existent 'followed' property with proper follow checking
- Add helper method checkIfFollowing to check if user follows an author
- Add helper method checkIfFriendOfFriend for two-hop social graph filtering
- Use CoreData relationships to properly check follow status

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Restructure notification processing to handle async operations properly
- Split the notification processing into multiple context blocks
- Use a two-phase approach: first find event and create notification, then apply filtering rules
- Use explicit shouldShowNotification flag instead of early returns
- Save context at appropriate points to ensure data is properly persisted

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Fix 'Unexpected non-void return value in void function' errors
- Use proper void returns instead of nil returns
- Rename tuple variable for clarity and use better destructuring
- Add explicit return type annotation to ensure correct typing

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Separate notification settings into source filtering and thread replies toggle
- Add 'notifyOnThreadReplies' preference for thread replies without explicit mentions
- Remove explicitMentionsOnly option in favor of a more user-friendly approach
- Improve UI with separate sections for different notification settings
- Update notification detection logic to handle thread replies separately
- Add more descriptive localized strings with better organization
- Set thread replies toggle default to true

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add navigation to view muted users list
- Add placeholder for future muted threads feature
- Create visual design that matches the rest of the settings
- Add 'Coming Soon' indicator for muted threads
- Add new localization strings for muted content management
- Add section header for better organization

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Fix 'Value of optional type must be unwrapped' error
- Add nil check before using currentAuthor in isReply check
- Use conditional expression with nil coalescing for safe unwrapping
- Maintain the same functionality with safer code

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Replace custom toggle style with existing NosToggle component
- Fix 'Cannot find NosToggleStyle in scope' compiler error
- Use the app's standard toggle component for consistency
- Maintain same visual appearance and functionality

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Replace NosToggle with standard Toggle + tint modifier
- Fix 'Extra trailing closure passed in call' compiler error
- Use direct SwiftUI Toggle with green tint for consistency
- Maintain same visual appearance and functionality

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add mutes case to NosNavigationDestination enum
- Add MutesView case handler in NosNavigationStack
- Fix button navigation by using router.push(.mutes) syntax
- Remove incorrect MutesDestination() class usage

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Improve Thread Notifications title and description for clarity
- Change 'Source Filter Title' to 'Show Mentions From' for better understanding
- Update preference options with more friendly wording
- Make description text more conversational and user-focused
- Reword 'Only from my network' to 'Your Extended Network'

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Change option labels to much shorter, clearer terms
- Make 'All Mentions' simply 'Anyone'
- Change to 'People I Follow' and 'My Network' for clarity
- Improve description text to be more direct and concise
- Update section headers to be more action-oriented
- Increase font size of descriptions for better readability

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Revert hardcoded strings to use localization keys
- Ensure consistent usage of localization system across the app
- Add script to help merge strings-to-add.json into Localizable.xcstrings
- Follow app's existing pattern for localization
- Maintain same improved text but accessed through localization

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add comprehensive tests for notification filtering
- Test explicit mention detection for different mention formats
- Test following and friend-of-friend relationship checks
- Test thread replies preference functionality
- Add tests for muted user filtering
- Create test scenarios covering all filtering options

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Replace sed-based approach with Python JSON parsing
- Fix 'unescaped newline inside substitute pattern' error
- Use proper JSON merging to handle complex structures
- Maintain backup functionality and error checking
- Improve reliability and robustness of the script

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Replace Python JSON parsing with simpler text-based approach
- Fix JSON parsing issues by using awk instead of json libraries
- Use line-based processing to handle xcstrings format
- Add verification step to confirm successful insertion
- Keep backup functionality and error handling

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Create a Python script on the fly for proper JSON handling
- Use dedicated file for the Python code instead of inline
- Fix escaping issues with multiline strings
- Handle the JSON structure correctly with error recovery
- Add better error handling and verbose output

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Remove redundant description text from Who Can Notify Me section
- Remove duplicate information and simplify the UI
- Use direct description values instead of separate title and detail text
- Maintain visual hierarchy and readability with simpler design

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Added notification preference settings to control who can send notifications
- Added clarification text for 'Anyone' option
- Fixed notification filtering to respect user preferences
- Improved debugging for notification filtering
- Fixed format specifiers in localization strings
@rabble rabble requested a review from martindsq as a code owner April 6, 2025 07:40
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.

1 participant