compose_box: Add button to go the narrow message is being composed to.

This'll be shown only when in a different narrow from what
you're composing to.

Takes care of updating display of the button on moving from
one narrow to another and also on changing inputs. This is
what contributes to majority of js code in this commit.

We are not displaying this for private messages since we do not
have a consistent design for both stream and private compose areas.
See https://chat.zulip.org/#narrow/stream/101-design/topic/narrow.20to.20topic.2Fpms.20when.20composing/near/1318548

Thanks to Vlad Korobov for the icon and for proposing various
designs.
This commit is contained in:
Dinesh
2021-08-16 20:40:43 +05:30
committed by Tim Abbott
parent d00fa63aa4
commit 43107e1424
13 changed files with 96 additions and 0 deletions

View File

@@ -206,6 +206,8 @@ function initialize_compose_box() {
scroll_to_bottom_key_html: common.has_mac_keyboard()
? "Fn + <span class='tooltip_right_arrow'>→</span>"
: "End",
narrow_to_compose_recipients_key_html:
(common.has_mac_keyboard() ? "⌘" : "Ctrl") + " + .",
}),
);
$(`.enter_sends_${user_settings.enter_sends}`).show();