filter: Add title for an unknown user for the "sender" narrow case.

Previously, the message header for the "Messages sent by" view for
an invalid or unknown user was the value of the "sender" operand,
which was not a valid/known user email.

Now we show a standard title in the message header for this case:
"Messages sent by unknown user".
This commit is contained in:
Lauryn Menard
2025-09-09 15:32:42 +02:00
committed by Tim Abbott
parent ba33ef0054
commit d82083ca24
2 changed files with 19 additions and 12 deletions

View File

@@ -2337,6 +2337,7 @@ test("navbar_helpers", ({override}) => {
const sender = [{operator: "sender", operand: joe.email}];
const guest_sender = [{operator: "sender", operand: alice.email}];
const invalid_sender = [{operator: "sender", operand: "sally@doesnotexist.co"}];
const in_home = [{operator: "in", operand: "home"}];
const in_all = [{operator: "in", operand: "all"}];
const is_starred = [{operator: "is", operand: "starred"}];
@@ -2434,6 +2435,13 @@ test("navbar_helpers", ({override}) => {
title: "translated: Messages sent by translated: alice (guest)",
redirect_url_with_search: "/#narrow/sender/" + alice.user_id + "-alice",
},
{
terms: invalid_sender,
is_common_narrow: true,
icon: undefined,
title: "translated: Messages sent by unknown user",
redirect_url_with_search: "/#narrow/sender/undefined",
},
{
terms: is_starred,
is_common_narrow: true,