compose: Show a one-time banner for jump to sent message conversation.

We immediately navigate the user to the conversation they just
sent a message to if they are not already in the appropriate
conversation view.

This commit adds a first-time banner to explain the same.

Fixes #29575.
This commit is contained in:
Prakhar Pratyush
2024-04-03 15:31:57 +05:30
committed by Tim Abbott
parent e4cbca698d
commit 22f3aebb33
6 changed files with 37 additions and 1 deletions

View File

@@ -287,6 +287,17 @@ export function initialize() {
},
);
const jump_to_conversation_banner_selector = `.${CSS.escape(compose_banner.CLASSNAMES.jump_to_sent_message_conversation)}`;
$("body").on(
"click",
`${jump_to_conversation_banner_selector} .main-view-banner-action-button`,
(event) => {
event.preventDefault();
$(event.target).parents(`${jump_to_conversation_banner_selector}`).remove();
onboarding_steps.post_onboarding_step_as_read("jump_to_conversation_banner");
},
);
for (const classname of Object.values(compose_banner.CLASSNAMES)) {
const classname_selector = `.${CSS.escape(classname)}`;
$("body").on("click", `${classname_selector} .main-view-banner-close-button`, (event) => {