message_view: Fix scroll jumps to top when user sends a message.

When navigating user to a `near` narrow if
`first_unread_msg_id_pending_server_verification`,
we didn't remove the `with` term, which results in
`is_conversation_view_with_near` check failing and hence
results in unexpected behaviour.
This commit is contained in:
Aman Agrawal
2025-07-29 08:29:30 +05:30
committed by Tim Abbott
parent 3dec633ac4
commit e5ca153673

View File

@@ -820,13 +820,18 @@ export let show = (raw_terms: NarrowTerm[], show_opts: ShowMessageViewOpts): voi
) { ) {
// We convert the current narrow into a `near` narrow so that // We convert the current narrow into a `near` narrow so that
// user doesn't accidentally mark msgs read which they haven't seen. // user doesn't accidentally mark msgs read which they haven't seen.
const terms = [ let terms = [
...msg_list.data.filter.terms(), ...msg_list.data.filter.terms(),
{ {
operator: "near", operator: "near",
operand: current_selected_id.toString(), operand: current_selected_id.toString(),
}, },
]; ];
assert(msg_list.data.filter.is_conversation_view());
// Using both /with/ and /near/ operators in a single view doesn't
// make sense, and checks like is_conversation_view_with_near do not
// handle that combination correctly.
terms = terms.filter((term) => term.operator !== "with");
const opts = { const opts = {
trigger: "old_unreads_missing", trigger: "old_unreads_missing",
}; };