mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
topic_list: Update the order of "Followed" topics in the muted stream.
For sorting topics in the left sidebar topics list, the "Followed" topics are treated the same as "Unmuted" topics. In a muted stream and not zoomed state: * followed/unmuted topics at the top. In an unmuted stream or zoomed state in a muted stream: * normal recency sorting The reason is that the "Followed" topics have a tier of interest above being unmuted, so they shouldn't lie below the "Unmuted" topics in the list.
This commit is contained in:
committed by
Tim Abbott
parent
5d069b7d7a
commit
20886b80d9
@@ -128,13 +128,13 @@ export function get_list_info(stream_id, zoomed, search_term) {
|
||||
}
|
||||
|
||||
if (stream_muted && !zoomed) {
|
||||
const unmuted_topics = topic_names.filter((topic) =>
|
||||
user_topics.is_topic_unmuted(stream_id, topic),
|
||||
const unmuted_or_followed_topics = topic_names.filter((topic) =>
|
||||
user_topics.is_topic_unmuted_or_followed(stream_id, topic),
|
||||
);
|
||||
choose_topics(stream_id, unmuted_topics, zoomed, topic_choice_state);
|
||||
choose_topics(stream_id, unmuted_or_followed_topics, zoomed, topic_choice_state);
|
||||
|
||||
const other_topics = topic_names.filter(
|
||||
(topic) => !user_topics.is_topic_unmuted(stream_id, topic),
|
||||
(topic) => !user_topics.is_topic_unmuted_or_followed(stream_id, topic),
|
||||
);
|
||||
choose_topics(stream_id, other_topics, zoomed, topic_choice_state);
|
||||
} else {
|
||||
|
||||
@@ -265,7 +265,7 @@ test("get_list_info unreads", ({override}) => {
|
||||
// this should make topic 5 at top in items array
|
||||
general.is_muted = true;
|
||||
add_unreads("topic 5", 1);
|
||||
override(user_topics, "is_topic_unmuted", (stream_id, topic_name) => {
|
||||
override(user_topics, "is_topic_unmuted_or_followed", (stream_id, topic_name) => {
|
||||
assert.equal(stream_id, general.stream_id);
|
||||
return topic_name === "topic 5";
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user