Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
muted_users: Add reveal button for hidden messages.
apoorvapendsee8fefa0c21d0
diff --git a/web/src/click_handlers.ts b/web/src/click_handlers.tsindex 7df4bd9e36a..6923b52418b 100644--- a/web/src/click_handlers.ts+++ b/web/src/click_handlers.ts@@ -162,6 +162,11 @@ export function initialize(): void {return true;}+ // Reveal button for a hidden message+ if ($target.closest(".reveal-hidden-message").length > 0) {+ return true;+ }+return false;}@@ -252,7 +257,7 @@ export function initialize(): void {reactions.process_reaction_click(message_id, local_id);});- $("body").on("click", ".reveal_hidden_message", (e) => {+ $("body").on("click", ".reveal-hidden-message", (e) => {assert(message_lists.current !== undefined);const message_id = rows.id($(e.currentTarget).closest(".message_row"));message_lists.current.view.reveal_hidden_message(message_id);diff --git a/web/styles/message_row.css b/web/styles/message_row.cssindex 3e76236a08e..9e1ec582be2 100644--- a/web/styles/message_row.css+++ b/web/styles/message_row.css@@ -94,6 +94,25 @@visibility: visible;}}++ &:hover .reveal-hidden-message {+ opacity: 1;+ }+}++.reveal-hidden-message {+ opacity: 0;+ transition: opacity 0.2s ease;+ margin-left: 0.1em;+ /* This is meant to offset the vertical padding of 0.125rem introduced+ by the action button, which otherwise makes this button look at a+ slightly lower height than the muted message notice. */+ margin-top: -0.125em;+ /* Source : https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@media/hover */+ @media (hover: none) {+ opacity: 1;+ transition: none;+ }}.messagebox-content {@@ -215,9 +234,15 @@}}- .muted-message-notice {- opacity: 0.5;- user-select: none;+ .muted-message-notice-container {+ display: flex;+ align-items: flex-start;+ gap: 0.2em;++ > .muted-message-notice {+ opacity: 0.5;+ user-select: none;+ }}.message_reactions {diff --git a/web/templates/message_hidden_dialog.hbs b/web/templates/message_hidden_dialog.hbsindex c8a00137461..561d75a976f 100644--- a/web/templates/message_hidden_dialog.hbs+++ b/web/templates/message_hidden_dialog.hbs@@ -1,5 +1,9 @@-<p>+<p class="muted-message-notice-container"><span class="muted-message-notice">{{t "Message from a muted user." }}</span>+ <button class="action-button action-button-borderless-neutral reveal-hidden-message reveal-button" tabindex="0" aria-label="{{t 'Reveal message from muted user' }}">+ <i class="zulip-icon zulip-icon-eye"></i>+ <span class="action-button-label">{{t 'Reveal'}}</span>+ </button></p>