mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 08:26:11 +00:00
narrow_operators: Add with operator to filter.is_conversation_view.
This commit updates "filter.is_conversation_view" to be true for "with" operator. This is important because essentially, the "with" operator lands you in the same view as the channel-topic narrow or the "dm" narrow i.e., the last unread message of the narrow. Hence, the "with" narrow should be handled in a similar way while determining whether to allow automatically marking messages as read, or displaying the unread banner, etc. Fixes #30863
This commit is contained in:
@@ -1571,7 +1571,11 @@ export class Filter {
|
||||
|
||||
is_conversation_view(): boolean {
|
||||
const term_type = this.sorted_term_types();
|
||||
if (_.isEqual(term_type, ["channel", "topic"]) || _.isEqual(term_type, ["dm"])) {
|
||||
if (
|
||||
_.isEqual(term_type, ["channel", "topic", "with"]) ||
|
||||
_.isEqual(term_type, ["channel", "topic"]) ||
|
||||
_.isEqual(term_type, ["dm"])
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -412,7 +412,7 @@ test("basics", () => {
|
||||
assert.ok(filter.includes_full_stream_history());
|
||||
assert.ok(filter.can_apply_locally());
|
||||
assert.ok(!filter.is_personal_filter());
|
||||
assert.ok(!filter.is_conversation_view());
|
||||
assert.ok(filter.is_conversation_view());
|
||||
assert.ok(filter.can_bucket_by("channel", "topic", "with"));
|
||||
assert.ok(!filter.is_conversation_view_with_near());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user