Skip to content

feat: jump to oldest unread message upon opening a thread, display divider between read/unread#3693

Merged
jamesarich merged 5 commits into
meshtastic:mainfrom
mdecourcy:feat/scroll-to-unread
Nov 14, 2025
Merged

feat: jump to oldest unread message upon opening a thread, display divider between read/unread#3693
jamesarich merged 5 commits into
meshtastic:mainfrom
mdecourcy:feat/scroll-to-unread

Conversation

@mdecourcy

Copy link
Copy Markdown
Contributor

closes #3689

preview:
image

@github-actions github-actions Bot added the enhancement New feature or request label Nov 13, 2025
@codecov

codecov Bot commented Nov 13, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 277 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.50%. Comparing base (ac5412b) to head (d6ab109).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
...in/org/meshtastic/feature/messaging/MessageList.kt 0.00% 156 Missing and 1 partial ⚠️
...kotlin/org/meshtastic/feature/messaging/Message.kt 0.00% 51 Missing ⚠️
...meshtastic/feature/messaging/DeliveryInfoDialog.kt 0.00% 34 Missing ⚠️
...g/meshtastic/core/ui/component/ScrollExtensions.kt 0.00% 15 Missing ⚠️
...eshtastic/core/data/repository/PacketRepository.kt 0.00% 10 Missing ⚠️
...g/meshtastic/feature/messaging/MessageViewModel.kt 0.00% 9 Missing ⚠️
...meshtastic/feature/messaging/MessageScreenEvent.kt 0.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread feature/messaging/src/main/kotlin/org/meshtastic/feature/messaging/MessageList.kt Outdated
Comment thread feature/messaging/src/main/kotlin/org/meshtastic/feature/messaging/MessageList.kt Outdated

@DaneEvans DaneEvans left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code looks fine - need to test it yet.

@DaneEvans

Copy link
Copy Markdown
Collaborator

I'd rather you try and reduce the complexity, rather than suppress it. That function has a lot of closing braces in a row

@jamesarich jamesarich added this pull request to the merge queue Nov 14, 2025
Merged via the queue into meshtastic:main with commit 2a081f3 Nov 14, 2025
5 of 6 checks passed
mdecourcy added a commit to mdecourcy/Meshtastic-Android that referenced this pull request Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Jump to Earliest Unread Message in Threads

4 participants