feat: jump to oldest unread message upon opening a thread, display divider between read/unread#3693
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3693 +/- ##
========================================
- Coverage 0.51% 0.50% -0.01%
========================================
Files 376 378 +2
Lines 21214 21470 +256
Branches 2556 2620 +64
========================================
Hits 109 109
- Misses 21085 21340 +255
- Partials 20 21 +1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Pull Request Overview
This PR implements functionality to jump to the oldest unread message when opening a message thread and displays a visual divider between read and unread messages. The implementation tracks the last read message for each contact in the database and uses this information to determine the initial scroll position.
Key changes:
- Added database fields (
lastReadMessageUuid,lastReadMessageTimestamp) to track last read message per contact - Implemented smart scrolling logic to position the list at the earliest unread message
- Added an unread messages divider UI component displayed above unread messages
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| ContactSettings entity | Added fields to track last read message UUID and timestamp |
| MeshtasticDatabase | Incremented schema version to 23 with auto-migration |
| PacketRepository | Added updateLastReadMessage method to persist last read state |
| MessageViewModel | Updated clearUnreadCount to track message UUID and timestamp, with duplicate call prevention |
| MessageScreenEvent | Updated ClearUnreadCount event to include message UUID and timestamp |
| Message.kt | Implemented initial scroll logic to jump to earliest unread message with state management |
| MessageList.kt | Added unread divider UI, refactored message rendering with sealed interface, updated auto-scroll behavior |
| ScrollToTopExtensions | Generalized scroll function to support scrolling to any index with bidirectional fast-scroll |
| strings.xml | Added "New messages below" localization string |
DaneEvans
left a comment
There was a problem hiding this comment.
code looks fine - need to test it yet.
|
I'd rather you try and reduce the complexity, rather than suppress it. That function has a lot of closing braces in a row |
…vider between read/unread (meshtastic#3693)
closes #3689
preview:
