mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +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) {
 | 
					    if (stream_muted && !zoomed) {
 | 
				
			||||||
        const unmuted_topics = topic_names.filter((topic) =>
 | 
					        const unmuted_or_followed_topics = topic_names.filter((topic) =>
 | 
				
			||||||
            user_topics.is_topic_unmuted(stream_id, 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(
 | 
					        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);
 | 
					        choose_topics(stream_id, other_topics, zoomed, topic_choice_state);
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -265,7 +265,7 @@ test("get_list_info unreads", ({override}) => {
 | 
				
			|||||||
    // this should make topic 5 at top in items array
 | 
					    // this should make topic 5 at top in items array
 | 
				
			||||||
    general.is_muted = true;
 | 
					    general.is_muted = true;
 | 
				
			||||||
    add_unreads("topic 5", 1);
 | 
					    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);
 | 
					        assert.equal(stream_id, general.stream_id);
 | 
				
			||||||
        return topic_name === "topic 5";
 | 
					        return topic_name === "topic 5";
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user