Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion mobile/lib/features/channels/channels_page/body.dart
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,11 @@ class _SliverChannelsList extends HookConsumerWidget {
if (ts != null) {
ref
.read(readStateProvider.notifier)
.markContextRead(channel.id, ts);
.markContextRead(
channel.id,
ts,
clearForcedMessages: true,
);
ref
.read(channelsProvider.notifier)
.clearObservedUnreadCoveredByRead(channel.id, ts);
Expand Down
11 changes: 9 additions & 2 deletions mobile/lib/features/channels/channels_page/channel_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,21 @@ class _ChannelTile extends ConsumerWidget {
onMarkRead?.call();
ref
.read(readStateProvider.notifier)
.markContextRead(channel.id, ts);
.markContextRead(
channel.id,
ts,
clearForcedMessages: true,
);
ref
.read(channelsProvider.notifier)
.clearObservedUnreadCoveredByRead(channel.id, ts);
} else {
ref
.read(readStateProvider.notifier)
.markContextUnread(channel.id);
.markContextUnread(
channel.id,
channelId: channel.id,
);
}
}
},
Expand Down
6 changes: 6 additions & 0 deletions mobile/lib/features/channels/channels_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import 'channel.dart';
import 'channel_management_provider.dart' show channelDetailsProvider;
import 'channel_mutes/channel_mutes_provider.dart';
import 'read_state/read_state_provider.dart';
import 'thread_follows/thread_follows_provider.dart';
import 'unread_badge/is_high_priority_event.dart';
import 'unread_badge/observed_unread_event.dart';
import 'unread_badge/should_notify_for_event.dart';
Expand Down Expand Up @@ -545,6 +546,7 @@ class ChannelsNotifier extends AsyncNotifier<List<Channel>> {
event,
myPk,
participatedRootIds: _participatedRootIds,
followedRootIds: _followedRootIds(),

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.

πŸ€– Could we add one notifier-level test showing that a reply in a followed thread actually badges its channel? Storage and menu toggling are covered, but the headline wiring from threadFollowsProvider through shouldNotifyForEvent is not, so a provider or root-ID mismatch could leave follows as a silent no-op.

authoredRootIds: _authoredRootIds,
mutedChannelIds: mutedChannelIds,
channelId: channel.id,
Expand Down Expand Up @@ -585,6 +587,7 @@ class ChannelsNotifier extends AsyncNotifier<List<Channel>> {
event,
myPk,
participatedRootIds: _participatedRootIds,
followedRootIds: _followedRootIds(),
authoredRootIds: _authoredRootIds,
mutedChannelIds: mutedChannelIds,
channelId: channel.id,
Expand All @@ -609,6 +612,9 @@ class ChannelsNotifier extends AsyncNotifier<List<Channel>> {
if (entry.value.muted) entry.key,
};

Set<String> _followedRootIds() =>
ref.read(threadFollowsProvider).followedRootIds;

void _loadThreadInterestStores(String pubkey) {
final normalizedPubkey = pubkey.toLowerCase();
if (_threadInterestPubkey == normalizedPubkey) return;
Expand Down
Loading
Loading