Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
compose: Rework alignment of upper elements, and redesign close icon.
N-Shar-ma906a9ca8f2db
diff --git a/web/src/compose_actions.ts b/web/src/compose_actions.tsindex 8310988ab8f..7be97ac0ed0 100644--- a/web/src/compose_actions.ts+++ b/web/src/compose_actions.ts@@ -149,7 +149,6 @@ export function autosize_message_content(opts: ComposeActionsStartOpts): void {export function expand_compose_box(): void {$("#compose_close").attr("data-tooltip-template-id", "compose_close_tooltip_template");- $("#compose_close").show();$("#compose_controls").hide();$(".message_comp").show();}@@ -395,7 +394,6 @@ export function cancel(): void {return;}hide_box();- $("#compose_close").hide();clear_box();compose_banner.clear_message_sent_banners();call_hooks(compose_cancel_hooks);diff --git a/web/src/tippyjs.ts b/web/src/tippyjs.tsindex dd78bbb5024..cb296e1797b 100644--- a/web/src/tippyjs.ts+++ b/web/src/tippyjs.ts@@ -258,12 +258,9 @@ export function initialize(): void {});tippy.delegate("body", {- target: [- "#compose_top_right [data-tippy-content]",- ".expand-composebox-button",- ".collapse-composebox-button",- "#compose_top_right [data-tooltip-template-id]",- ].join(","),+ target: ["#compose_close", ".expand-composebox-button", ".collapse-composebox-button"].join(+ ",",+ ),delay: LONG_HOVER_DELAY,appendTo: () => document.body,onHidden(instance) {diff --git a/web/styles/app_variables.css b/web/styles/app_variables.cssindex 0e95dae0dad..2421681060e 100644--- a/web/styles/app_variables.css+++ b/web/styles/app_variables.css@@ -166,6 +166,20 @@*/--composebox-buttons-width: 25px;+ /*+ Width of the send menu area with the Send button, Draft(s) button+ and the vdots.+ */+ --compose-send-controls-width: 112px;++ @media ((width >= $sm_min) and (width < $mc_min)) {+ --compose-send-controls-width: 62px;+ }++ @media (width < $sm_min) {+ --compose-send-controls-width: 28px;+ }+/*Width to be reserved for document scrollbar when scrolling is disabled.Using `scrollbar-gutter` would be more appropriate but doesn't has widediff --git a/web/styles/compose.css b/web/styles/compose.cssindex 2eadab4c9e3..0235ef214bc 100644--- a/web/styles/compose.css+++ b/web/styles/compose.css@@ -142,6 +142,9 @@#compose_banners {max-height: min(25vh, 240px);overflow-y: auto;+ /* Align to compose controls; that's 112px width,+ plus 6px of grid gap for 118px here. */+ margin-right: calc(var(--compose-send-controls-width) + 6px);}}@@ -256,25 +259,15 @@display: grid;/* Vlad's design calls for 122px for the send columnat its widest; 112px accounts for 6px of gap and- 4px outside padding.-- TODO: get this value into a CSS variable. */- grid-template: minmax(0, 1fr) 32px / minmax(0, 1fr) 112px;+ 4px outside padding. */+ grid-template: minmax(0, 1fr) 32px / minmax(0, 1fr) var(+ --compose-send-controls-width+ );grid-template-areas:"message-content-container message-send-controls-container""message-formatting-controls-container . ";gap: 4px 6px;margin-top: 5px;-- @media ((width >= $sm_min) and (width < $mc_min)) {- /* Drop to a 62px wide send column. */- grid-template-columns: minmax(0, 1fr) 62px;- }-- @media (width < $sm_min) {- /* Drop to a 28px wide send column. */- grid-template-columns: minmax(0, 1fr) 28px;- }}.message_content {@@ -419,53 +412,32 @@align-items: flex-start;/* Matched to 6px grid-gap on .messagebox grid. */padding-bottom: 6px;-}--#compose_top_right {- display: flex;- align-items: center;- height: var(--compose-recipient-box-min-height);/* Align to compose controls; that's 112px width,- plus 6px of grid gap for 118px here.-- TODO: Make variables here; expanded use of grid- on the compose box will make these unnecessary,- eventually. */- width: calc(112px + 6px);- justify-content: flex-end;-- @media ((width >= $sm_min) and (width < $mc_min)) {- /* Align to compose controls at narrower widths */- width: calc(62px + 6px);- }-- @media (width < $sm_min) {- /* Don't attempt to control the width- at narrowest widths. */- width: auto;- }-- & button {- background: transparent;- color: inherit;- font-size: 15px;- font-weight: normal;- line-height: 20px;- opacity: 0.7;- border: 0;- padding: 0;- margin-left: 4px;- vertical-align: unset;- text-shadow: none;-- &:hover {- opacity: 1;- }- }+ plus 6px of grid gap for 118px here. */+ margin-right: calc(var(--compose-send-controls-width) + 6px);}#compose_close {- display: none;+ position: absolute;+ top: 0;+ right: 0;+ color: var(--color-compose-send-control-button);+ background: transparent;+ font-size: 15px;+ font-weight: normal;+ line-height: 20px;+ opacity: 0.7;+ border: 0;+ padding: 5px 7px;+ border-radius: 8px;+ vertical-align: unset;+ text-shadow: none;++ &:hover {+ opacity: 1;+ background: var(--color-compose-embedded-button-background-hover);+ color: var(--color-compose-send-control-button-interactive);+ }}.main-view-banner {diff --git a/web/templates/compose.hbs b/web/templates/compose.hbsindex 93a5d4dee30..baaf3252488 100644--- a/web/templates/compose.hbs+++ b/web/templates/compose.hbs@@ -49,10 +49,7 @@<form id="send_message_form" action="/json/messages" method="post"><div class="compose_table"><div id="compose_top">- <div id="compose_top_right" class="order-2">- <button type="button" class="close fa fa-times" id='compose_close' data-tooltip-template-id="compose_close_tooltip_template"></button>- </div>- <div id="compose-recipient" class="order-1">+ <div id="compose-recipient">{{> dropdown_widget_wrapperwidget_name="compose_select_recipient"}}<div class="topic-marker-container">@@ -110,5 +107,6 @@</div></form></div>+ <button type="button" class="close zulip-icon zulip-icon-close" id='compose_close' data-tooltip-template-id="compose_close_tooltip_template"></button></div></div>