compose: Restore low-attention recipient row when narrow matches.

This commit is contained in:
Karl Stolley
2025-08-09 11:53:23 -04:00
committed by Tim Abbott
parent 224fd3df6b
commit aae826744e
2 changed files with 9 additions and 6 deletions

View File

@@ -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 {

View File

@@ -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