Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
top_navbar: Render long stream description on hover.
Apoorva Pendse21500eddcf26
diff --git a/web/src/message_view_header.ts b/web/src/message_view_header.tsindex a3d0d3fb1ec..1cf488abd5c 100644--- a/web/src/message_view_header.ts+++ b/web/src/message_view_header.ts@@ -165,6 +165,55 @@ function build_message_view_header(filter: Filter | undefined): void {export function initialize(): void {render_title_area();++ const hide_stream_settings_button_width_threshold = 620;+ $("body").on("mouseenter mouseleave", ".narrow_description", function (event) {+ const $view_description_elt = $(this);+ const window_width = $(window).width()!;+ let hover_timeout;++ if (event.type === "mouseenter") {+ if (!$view_description_elt.hasClass("view-description-extended")) {+ const current_width = $view_description_elt.outerWidth();+ // Set fixed width for word-wrap to work+ $view_description_elt.css("width", current_width + "px");+ }+ hover_timeout = setTimeout(() => {+ $view_description_elt.addClass("view-description-extended");+ $(".top-navbar-container").addClass(+ "top-navbar-container-allow-description-extension",+ );++ if (window_width <= hide_stream_settings_button_width_threshold) {+ $(".message-header-stream-settings-button").hide();+ // Let it expand naturally on smaller screens+ $view_description_elt.css("width", "");+ }+ }, 250);+ $view_description_elt.data("hover_timeout", hover_timeout);+ } else if (event.type === "mouseleave") {+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment+ hover_timeout = $view_description_elt.data("hover_timeout");+ if (typeof hover_timeout === "number") {+ // Clear any pending hover_timeout to prevent unexpected behavior+ clearTimeout(hover_timeout);+ }+ $view_description_elt.addClass("leaving-extended-view-description");++ // Wait for the reverse animation duration before cleaning up+ setTimeout(() => {+ $view_description_elt.removeClass("view-description-extended");+ $view_description_elt.removeClass("leaving-extended-view-description");+ if (window_width <= hide_stream_settings_button_width_threshold) {+ $(".message-header-stream-settings-button").show();+ $view_description_elt.css("width", "");+ } else {+ // Reset to flexbox-determined width+ $view_description_elt.css("width", "");+ }+ }, 100);+ }+ });}export function render_title_area(): void {diff --git a/web/styles/message_view_header.css b/web/styles/message_view_header.cssindex 8401e5b28c6..6c5430d3380 100644--- a/web/styles/message_view_header.css+++ b/web/styles/message_view_header.css@@ -119,4 +119,50 @@vertical-align: middle;}}++ .view-description-extended {+ overflow-wrap: break-word;+ hyphens: auto;+ overflow: hidden;+ white-space: normal;+ background-color: var(--color-background-navbar);+ border-radius: 5px;+ animation: expand-extended-description 100ms ease-in both;++ &.leaving-extended-view-description {+ animation: contract-extended-description 100ms ease-in both !important;+ }+ }+}++/* Media Queries */+@media only screen and (width <= 620px) {+ .view-description-extended {+ padding-top: 10px !important;+ }+}++/* stylelint-disable plugin/no-low-performance-animation-properties */+@keyframes expand-extended-description {+ from {+ max-height: var(--header-height);+ padding-bottom: 0;+ }++ to {+ max-height: 1000px;+ padding-bottom: 5px;+ }+}++@keyframes contract-extended-description {+ from {+ max-height: 1000px;+ padding-bottom: 5px;+ }++ to {+ max-height: var(--header-height);+ padding-bottom: 0;+ }}diff --git a/web/styles/zulip.css b/web/styles/zulip.cssindex 4c11ebf7bfe..ccd7b60709b 100644--- a/web/styles/zulip.css+++ b/web/styles/zulip.css@@ -1025,6 +1025,10 @@ div.focused-message-list.is-conversation-view .recipient_row {text-overflow: ellipsis;}+.top-navbar-container-allow-description-extension {+ overflow: visible;+}+#streamlist-toggle {display: none;position: absolute;