Fix list ordering and long-list scrolling

- Sort channels by latest message and contacts by recent message using local
  arrival time instead of the sender's clock.
- Contacts added from a card sort by when they were added until the radio
  hears an advert (app-side only; lastAdvert stays 0).
- Stop entrance animations on rows scrolled into view and reuse unchanged
  contact rows across connector updates.
This commit is contained in:
zjs81 committed 2026-11-20 16:37:47 -07:00
1 parent 34ea0cb7ca
commit 316088dfd6
35 files changed
+1357 -43

No files matched your search

+2 -1
View File
@@ -783,13 +783,14 @@ class _ChannelsScreenState extends State<ChannelsScreen> {
break;
case ChannelSortOption.latestMessages:
// Filtered messages don't bump a channel, matching the preview.
// Ordered by local arrival time: sender clocks can be far off.
// Looked up once per channel: the lookup can scan back through
// filtered messages, and the comparator runs O(n log n) times.
final epoch = DateTime(1970);
final latest = <Channel, DateTime>{
for (final channel in filtered)
channel:
connector.latestVisibleChannelMessage(channel)?.timestamp ??
connector.latestVisibleChannelMessage(channel)?.receivedAt ??
epoch,
};
filtered.sort((a, b) {