Merge pull request #680 from zjs81/fix/chat-scroll-and-keyboard

Keep chat reading position during sync, selection and app switches
This commit is contained in:
zjs81 authored and GitHub committed 2026-11-21 07:38:06 -07:00
commit b5d9dea1c3
9 files changed
+1460 -10

No files matched your search

+7 -2
View File
@@ -9263,8 +9263,13 @@ class MeshCoreConnector extends ChangeNotifier {
}
messages.add(message);
if (messages.length > _messageWindowSize) {
final trimCount = messages.length - _messageWindowSize;
// The open chat keeps the older pages its reader scrolled back to;
// trimming them would pull the history out from under the reader.
final windowSize = pubKeyHex == _activeContactKey
? MessageStore.maxStoredMessages
: _messageWindowSize;
if (messages.length > windowSize) {
final trimCount = messages.length - windowSize;
_messageStore.archive(pubKeyHex, messages.sublist(0, trimCount));
messages.removeRange(0, trimCount);
}