From aae826744ef892e91f8c007eebd16543a98b2cd4 Mon Sep 17 00:00:00 2001 From: Karl Stolley Date: Sat, 9 Aug 2025 11:53:23 -0400 Subject: [PATCH] compose: Restore low-attention recipient row when narrow matches. --- web/src/compose_recipient.ts | 3 +-- web/src/compose_setup.js | 12 ++++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/web/src/compose_recipient.ts b/web/src/compose_recipient.ts index 8730b6bd0e..428845cfe9 100644 --- a/web/src/compose_recipient.ts +++ b/web/src/compose_recipient.ts @@ -73,8 +73,7 @@ export let update_recipient_row_attention_level = (): void => { // that call set_high_attention_recipient_row(). if ( (composing_to_current_topic_narrow() || composing_to_current_private_message_narrow()) && - compose_state.has_full_recipient() && - !compose_state.is_recipient_edited_manually() + compose_state.has_full_recipient() ) { $("#compose-recipient").toggleClass("low-attention-recipient-row", true); } else { diff --git a/web/src/compose_setup.js b/web/src/compose_setup.js index 7b7c9315e7..9c1517cb7e 100644 --- a/web/src/compose_setup.js +++ b/web/src/compose_setup.js @@ -603,9 +603,9 @@ export function initialize() { const $input = $("input#stream_message_recipient_topic"); compose_recipient.update_topic_displayed_text($input.val(), true); compose_recipient.update_compose_area_placeholder_text(); - // Once the topic input has been focused, we no longer treat + // When the topic input is focused, we no longer treat // the recipient row as low attention, as we assume the user - // has done something that requires keeping attention called + // is doing something that requires keeping attention called // to the recipient row compose_recipient.set_high_attention_recipient_row(); @@ -620,13 +620,17 @@ export function initialize() { }); $("#private_message_recipient").on("focus", () => { - // Once the DM input has been focused, we no longer treat + // When the DM input is focused, we no longer treat // the recipient row as low attention, as we assume the user - // has done something that requires keeping attention called + // is doing something that requires keeping attention called // to the recipient row compose_recipient.set_high_attention_recipient_row(); }); + $("input#stream_message_recipient_topic, #private_message_recipient").on("blur", () => { + compose_recipient.update_recipient_row_attention_level(); + }); + $(window).on("blur", () => { // Save drafts when the window loses focus to help // ensure no work is lost