Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
message_grid: Preserve grid layout in edit mode.
Karl Stolley497ad9471a89
diff --git a/web/src/message_list.js b/web/src/message_list.jsindex 78a2549ab18..a6902fbdf9f 100644--- a/web/src/message_list.js+++ b/web/src/message_list.js@@ -382,7 +382,11 @@ export class MessageList {return;}$row.find(".message_edit_form").append(edit_obj.$form);- $row.find(".message_content, .status-message, .message_controls").hide();+ // Hide the original message with visibility: hidden,+ // so its baseline is still detectable on other columns+ // in the grid for a consistent layout in the edit state+ $row.find(".message_content").css("visibility", "hidden");+ $row.find(".status-message, .message_controls").hide();$row.find(".sender-status").toggleClass("sender-status-edit");$row.find(".messagebox-content").addClass("content_edit_mode");$row.find(".message_edit").css("display", "block");@@ -390,7 +394,8 @@ export class MessageList {}hide_edit_message($row) {- $row.find(".message_content, .status-message, .message_controls").show();+ $row.find(".message_content").css("visibility", "visible");+ $row.find(".status-message, .message_controls").show();$row.find(".sender-status").toggleClass("sender-status-edit");$row.find(".message_edit_form").empty();$row.find(".messagebox-content").removeClass("content_edit_mode");diff --git a/web/styles/message_row.css b/web/styles/message_row.cssindex 245e835d5ee..c7323340f46 100644--- a/web/styles/message_row.css+++ b/web/styles/message_row.css@@ -202,6 +202,11 @@ $time_column_max_width: 150px;.message_edit {grid-area: message;+ /* Align self to start, rather than baseline, so the baseline+ is preserved from the message itself--keeping the time,+ edit message, and controls at the same vertical alignment. */+ align-self: start;+ margin-top: $distance_of_non_text_elements_from_message_box;}.alert-msg {@@ -223,6 +228,11 @@ $time_column_max_width: 150px;". more . . "". reactions . . ";+ .message_edit {+ /* No top margin when there's a sender row */+ margin-top: 0;+ }+&.is-me-message {grid-template-areas:"avatar sender controls time"@@ -256,6 +266,19 @@ $time_column_max_width: 150px;display: inline;}}++ &.content_edit_mode {+ .message_sender {+ /* Keep the me-message participating in the baseline */+ visibility: hidden;+ }++ .message_edit {+ /* Use the sender grid area for the me-message edit/view-source box */+ grid-area: sender;+ margin-top: $distance_of_non_text_elements_from_message_box;+ }+ }}.inline_profile_picture {@@ -331,16 +354,6 @@ $time_column_max_width: 150px;align-self: baseline;}}-- &.content_edit_mode {- .is_me_message {- & ~ .alert-msg,- & ~ .message_time,- & ~ .message_controls {- grid-row: 1 / 2;- }- }- }}}