FEATURE: Allow users to manually track threads without replying (#22100)

This commit adds a tracking dropdown to each individual thread, similar to topics,
that allows the user to change the notification level for a thread manually. Previously
the user had to reply to a thread to track it and see unread indicators.

Since the user can now manually track threads, the thread index has also been changed
to only show threads that the user is a member of, rather than threads that they had sent
messages in.

Unread indicators also respect the notification level -- Normal level thread tracking
will not show unread indicators in the UI when new messages are sent in the thread.
This commit is contained in:
Martin Brennan
2023-06-16 12:08:26 +10:00
committed by GitHub
parent 783bce4b2c
commit d6374fdc53
38 changed files with 583 additions and 111 deletions

View File

@ -137,6 +137,21 @@ describe Chat::ThreadUnreadsQuery do
end
end
context "when the notification_level for the thread is normal" do
before do
thread_1
.user_chat_thread_memberships
.find_by(user: current_user)
.update!(notification_level: :normal)
end
it "gets a zeroed out count for the thread" do
expect(subject.map(&:to_h)).to include(
{ channel_id: channel_1.id, mention_count: 0, thread_id: thread_1.id, unread_count: 0 },
)
end
end
context "when the user is not a member of a thread" do
before { thread_1.user_chat_thread_memberships.find_by(user: current_user).destroy! }