Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
compose: Rename recipient row's outer structure.
Karl Stolleybab9ad89846c
diff --git a/web/src/compose_recipient.ts b/web/src/compose_recipient.tsindex ff7bf5dc367..8fb6b41cc51 100644--- a/web/src/compose_recipient.ts+++ b/web/src/compose_recipient.ts@@ -199,14 +199,14 @@ function update_recipient_label(stream_id?: number): void {export function update_compose_for_message_type(opts: ComposeTriggeredOptions): void {if (opts.message_type === "stream") {$("#compose-direct-recipient").hide();- $("#compose_recipient_box").show();+ $("#compose-channel-recipient").show();$("#stream_toggle").addClass("active");$("#private_message_toggle").removeClass("active");$("#compose-recipient").removeClass("compose-recipient-direct-selected");update_recipient_label(opts.stream_id);} else {$("#compose-direct-recipient").show();- $("#compose_recipient_box").hide();+ $("#compose-channel-recipient").hide();$("#stream_toggle").removeClass("active");$("#private_message_toggle").addClass("active");$("#compose-recipient").addClass("compose-recipient-direct-selected");@@ -402,7 +402,7 @@ export function update_topic_displayed_text(topic_name = "", has_topic_focus = f$input.removeClass("empty-topic-display empty-topic-only");$topic_not_mandatory_placeholder.removeClass("visible");$topic_not_mandatory_placeholder.hide();- $("#compose_recipient_box").removeClass("disabled");+ $("#compose-channel-recipient").removeClass("disabled");if (!stream_data.can_use_empty_topic(compose_state.stream_id())) {$input.attr("placeholder", $t({defaultMessage: "Topic"}));@@ -418,7 +418,7 @@ export function update_topic_displayed_text(topic_name = "", has_topic_focus = fcompose_state.topic("");$input.prop("disabled", true);$input.addClass("empty-topic-only");- $("#compose_recipient_box").addClass("disabled");+ $("#compose-channel-recipient").addClass("disabled");$("textarea#compose-textarea").trigger("focus");has_topic_focus = false;}diff --git a/web/src/compose_setup.ts b/web/src/compose_setup.tsindex 17879bcf5b6..0b5a9e219b0 100644--- a/web/src/compose_setup.ts+++ b/web/src/compose_setup.ts@@ -626,7 +626,7 @@ export function initialize(): void {}, 150),);- $("#compose_recipient_box").on("click", "#recipient_box_clear_topic_button", () => {+ $("#compose-channel-recipient").on("click", "#recipient_box_clear_topic_button", () => {const $input = $("input#stream_message_recipient_topic");// This should work similar to just manually deleting the// topicdiff --git a/web/src/onboarding_steps.ts b/web/src/onboarding_steps.tsindex 26769f2a6bf..4f4ed163c58 100644--- a/web/src/onboarding_steps.ts+++ b/web/src/onboarding_steps.ts@@ -175,7 +175,7 @@ function show_navigation_tour_video(navigation_tour_video_url: string | null): v},on_hide() {// `narrow_to_dm_with_welcome_bot_new_user` triggers a focus change from- // #compose_recipient_box to #compose-textarea (see `compose_actions.show_compose_box`+ // #compose-channel-recipient to #compose-textarea (see `compose_actions.show_compose_box`// with `opts.defer_focus = true`). We start initializing this modal while the// focus transition is in progress, resulting in a flaky behaviour of the// element that will be in focus when modal is closed.diff --git a/web/src/tippyjs.ts b/web/src/tippyjs.tsindex e7c9ed6d4a4..25c7ae955d2 100644--- a/web/src/tippyjs.ts+++ b/web/src/tippyjs.ts@@ -991,7 +991,7 @@ export function initialize(): void {});tippy.delegate("body", {- target: "#compose_recipient_box, #move-topic-new-topic-input-wrapper",+ target: "#compose-channel-recipient, #move-topic-new-topic-input-wrapper",delay: LONG_HOVER_DELAY,onShow(instance) {const $elem = $(instance.reference);diff --git a/web/styles/compose.css b/web/styles/compose.cssindex a21a10b9064..897f3f237d9 100644--- a/web/styles/compose.css+++ b/web/styles/compose.css@@ -1082,11 +1082,11 @@ textarea.new_message_textarea {}#message-content-container,-#compose_recipient_box {+#compose-channel-recipient {color: var(--color-text-default);}-#compose_recipient_box {+#compose-channel-recipient {display: grid;/* When displaying #topic-not-mandatory-placeholder,we let it occupy the entire topic box. Otherwise,@@ -1243,7 +1243,7 @@ textarea.new_message_textarea {#compose.compose-box-open {.low-attention-recipient-row:not(.recently-focused, :focus-within) {#compose_select_recipient_widget,- #compose_recipient_box,+ #compose-channel-recipient,#compose-direct-recipient .pill-container {transition: var(--compose-recipient-row-transition);transition-delay: var(--compose-recipient-row-transition-delay);@@ -1298,7 +1298,7 @@ textarea.new_message_textarea {}#compose_select_recipient_widget,- #compose_recipient_box,+ #compose-channel-recipient,#compose-direct-recipient .pill-container {background-color: transparent;border-color: transparent;diff --git a/web/templates/compose.hbs b/web/templates/compose.hbsindex c8eafd30e94..c6738fbc012 100644--- a/web/templates/compose.hbs+++ b/web/templates/compose.hbs@@ -62,7 +62,7 @@<div class="topic-marker-container"><a role="button" class="conversation-arrow zulip-icon zulip-icon-chevron-right"></a></div>- <div id="compose_recipient_box">+ <div id="compose-channel-recipient"><input type="text" name="stream_message_recipient_topic" id="stream_message_recipient_topic" maxlength="{{ max_topic_length }}" value="" placeholder="{{t 'Topic' }}" autocomplete="off" tabindex="0" aria-label="{{t 'Topic' }}" /><span id="topic-not-mandatory-placeholder" class="placeholder">{{> topic_not_mandatory_placeholder_text empty_string_topic_display_name=empty_string_topic_display_name}}diff --git a/web/tests/compose_actions.test.cjs b/web/tests/compose_actions.test.cjsindex a891df3d853..ceb561211ce 100644--- a/web/tests/compose_actions.test.cjs+++ b/web/tests/compose_actions.test.cjs@@ -205,7 +205,7 @@ test("start", ({override, override_rewire, mock_template}) => {start(opts);assert.ok($("#compose").hasClass("compose-box-open"));- assert_visible("#compose_recipient_box");+ assert_visible("#compose-channel-recipient");assert_hidden("#compose-direct-recipient");assert.equal(compose_state.stream_name(), "");