-
-
Notifications
You must be signed in to change notification settings - Fork 372
feat: word-based message filtering with quarantine approach (stored but hidden) #4241
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
Draft
mdecourcy
wants to merge
38
commits into
meshtastic:main
Choose a base branch
from
mdecourcy:feat/message-filter
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.
+2,108
−108
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✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4241 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 3 3
Lines 23 23
Branches 7 7
=====================================
Misses 23 23 ☔ View full report in Codecov by Sentry. |
Add FilterPrefs interface for managing message filter preferences: - filterEnabled: Boolean to enable/disable message filtering - filterWords: Set<String> for words to filter on Includes FilterPrefsImpl with SharedPreferences-backed storage using existing PrefDelegate and StringSetPrefDelegate patterns. Test coverage added for default values and preference updates.
- Add FilterSettings route to core navigation Routes.kt - Add FilterSettingsScreen composable to SettingsNavigation.kt - Add Message Filter ListItem to SettingsScreen for navigation - Bump database to v32/v33 schemas with AutoMigration
- Add _showFiltered state flow with toggle function - Add getFilteredCount() function to get filtered message count - Update pagedMessagesForContactKey to combine contactKey with showFiltered - Pass includeFiltered flag to packetRepository.getMessagesFromPaged
Wire up the filtered count and show/hide toggle from MessageViewModel to the MessageListPaged component. When there are filtered messages, a badge showing "X filtered" appears at the top with a visibility toggle button.
- Add filtered: Boolean property to Message data class - Pass filtered flag from PacketEntity.toMessage() to Message - Display "Filtered" label badge in message bubble when filtered - Apply dimmed alpha (0.5) to filtered messages for visual distinction - Add filtered message example to MessageItem preview
Add Hilt-based integration test verifying FilterPrefs and MessageFilterService work together correctly. Also add missing androidTest dependencies (ext.junit, coroutines.test).
Required for test compilation after interface changes.
Prevents the "Filtered" label from running into the RSSI value.
Adds a menu item in the chat overflow menu to enable/disable message filtering for the current contact. When disabled, messages from this contact will not be filtered regardless of filter words.
When filtering is disabled for a specific contact: - Include filtered messages in the query (don't hide them) - Hide the filtered count badge and toggle button - Remove extra top padding from message list
Previously isFiltered was added to isSilent, which only muted the notification sound but still showed it. Now filtered messages skip the notification call entirely.
…ts list - Filtered messages are now marked as read when saved, so they don't contribute to unread counts - Contacts list queries now exclude filtered messages, showing the last non-filtered message as the preview
Remove the regex toggle switch. Users now type regex:pattern directly in the input field for regex patterns. Simpler UI, power-user friendly.
- Remove the floating overlay that covered messages - Add "Show X filtered" / "Hide filtered" menu item in overflow menu - Only show when filteredCount > 0 and filtering is enabled for contact - Clean up unused imports and handlers
- Add missing filter strings to strings.xml - Update FilterSettingsScreen.kt to use stringResource() - Update Message.kt OverFlowMenu to use stringResource() - Update MessageItem.kt to use stringResource() All filter-related UI strings are now translation-ready for Crowdin.
Add tests for: - Filtered messages excluded from regular queries - getFilteredCount returns correct count - Contact filtering disabled persistence
… reduce complexity
98d8e58 to
d7f0b0b
Compare
… tests - Add assertFalse import to PacketDaoTest.kt - Add explicit Unit return type to test functions to fix runBlocking type inference issue - Update schema to match rebased main changes
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.
draft until I load test