From 99dbea3331364ec378c25237703e0758db9bd6f6 Mon Sep 17 00:00:00 2001 From: Joelute Date: Wed, 10 May 2023 19:25:20 -0400 Subject: [PATCH] narrow_banner: Drop empty action line from empty `dm-including:` views. Previously, when a user enters a empty dm-including view, they'll notice the "Why not start the conversation" action line and click on the link. When this happens, the compose box would open but the receipent box is never populated. Since the dm-including view is a search view, we should drop that phrase from dm-including views altogether. It also isn't super natural to have a button that starts the conversation with the user anyways. Fixes: #25524. --- web/src/narrow_banner.js | 9 --------- web/tests/narrow.test.js | 10 ++-------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/web/src/narrow_banner.js b/web/src/narrow_banner.js index 6dab67bab8..b9a7d30985 100644 --- a/web/src/narrow_banner.js +++ b/web/src/narrow_banner.js @@ -414,15 +414,6 @@ function pick_empty_narrow_banner() { }, {person: person_in_dms.full_name}, ), - html: $t_html( - { - defaultMessage: "Why not start the conversation?", - }, - { - "z-link": (content_html) => - `${content_html}`, - }, - ), }; } } diff --git a/web/tests/narrow.test.js b/web/tests/narrow.test.js index b58e4ab7d6..814d2e87a2 100644 --- a/web/tests/narrow.test.js +++ b/web/tests/narrow.test.js @@ -441,10 +441,7 @@ run_test("show_empty_narrow_message", ({mock_template}) => { narrow_banner.show_empty_narrow_message(); assert.equal( $(".empty_feed_notice_main").html(), - empty_narrow_html( - "translated: You have no direct messages including Example Bot yet.", - 'translated HTML: Why not start the conversation?', - ), + empty_narrow_html("translated: You have no direct messages including Example Bot yet."), ); // sending direct messages enabled @@ -454,10 +451,7 @@ run_test("show_empty_narrow_message", ({mock_template}) => { narrow_banner.show_empty_narrow_message(); assert.equal( $(".empty_feed_notice_main").html(), - empty_narrow_html( - "translated: You have no direct messages including Alice Smith yet.", - 'translated HTML: Why not start the conversation?', - ), + empty_narrow_html("translated: You have no direct messages including Alice Smith yet."), ); set_filter([["dm-including", me.email]]);