Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
right_sidebar: Extend user row hover outline left, to full width.
evykassirerc2e361caea29
diff --git a/web/src/click_handlers.ts b/web/src/click_handlers.tsindex 6ce5090de0b..733f63179d4 100644--- a/web/src/click_handlers.ts+++ b/web/src/click_handlers.ts@@ -533,55 +533,61 @@ export function initialize(): void {}// BUDDY LIST TOOLTIPS (not displayed on touch devices)- $(".buddy-list-section").on("mouseenter", ".selectable_sidebar_block", (e) => {- e.stopPropagation();- const user_id_string = $(e.currentTarget)- .closest(".user_sidebar_entry")- .attr("data-user-id")!;- const title_data = buddy_data.get_title_data(user_id_string, false);+ $(".buddy-list-section").on(+ "mouseenter",+ ".user_sidebar_entry",+ function (this: HTMLElement, e) {+ e.stopPropagation();+ const $elem = $(this);- // `target_node` is the `ul` element since it stays in DOM even after updates.- function get_target_node(): HTMLElement {- return util.the($(e.target).parents(".buddy-list-section"));- }+ const user_id_string = $elem.attr("data-user-id")!;+ const title_data = buddy_data.get_title_data(user_id_string, false);- function check_reference_removed(- mutation: MutationRecord,- instance: tippy.Instance,- ): boolean {- return Array.prototype.includes.call(- mutation.removedNodes,- instance.reference.parentElement,- );- }-- const $elem = $(e.currentTarget)- .closest(".user_sidebar_entry")- .find(".selectable_sidebar_block");- do_render_buddy_list_tooltip($elem, title_data, get_target_node, check_reference_removed);+ // `target_node` is the `ul` element since it stays in DOM even after updates.+ function get_target_node(): HTMLElement {+ return util.the($(e.target).parents(".buddy-list-section"));+ }- /*- The following implements a little tooltip giving the name for status emoji- when hovering them in the right sidebar. This requires special logic, to avoid- conflicting with the main tooltip or showing duplicate tooltips.- */- $(".user_sidebar_entry .status-emoji-name").off("mouseenter").off("mouseleave");- $(".user_sidebar_entry .status-emoji-name").on("mouseenter", () => {- const element: tippy.ReferenceElement = util.the($elem);- const instance = element._tippy;- if (instance?.state.isVisible) {- instance.destroy();+ function check_reference_removed(+ mutation: MutationRecord,+ instance: tippy.Instance,+ ): boolean {+ return Array.prototype.includes.call(+ mutation.removedNodes,+ instance.reference.parentElement,+ );}- });- $(".user_sidebar_entry .status-emoji-name").on("mouseleave", () => {+do_render_buddy_list_tooltip($elem,title_data,get_target_node,check_reference_removed,);- });- });++ /*+ The following implements a little tooltip giving the name for status emoji+ when hovering them in the right sidebar. This requires special logic, to avoid+ conflicting with the main tooltip or showing duplicate tooltips.+ */+ $(".user_sidebar_entry .status-emoji-name").off("mouseenter").off("mouseleave");+ $(".user_sidebar_entry .status-emoji-name").on("mouseenter", () => {+ const element: tippy.ReferenceElement = util.the($elem);+ const instance = element._tippy;+ if (instance?.state.isVisible) {+ instance.destroy();+ }+ });+ $(".user_sidebar_entry .status-emoji-name").on("mouseleave", () => {+ do_render_buddy_list_tooltip(+ $elem,+ title_data,+ get_target_node,+ check_reference_removed,+ );+ });+ },+ );// DIRECT MESSAGE LIST TOOLTIPS (not displayed on touch devices)$("body").on("mouseenter", ".dm-user-status", function (this: HTMLElement, e) {diff --git a/web/styles/right_sidebar.css b/web/styles/right_sidebar.cssindex 7259b846675..d238979f47f 100644--- a/web/styles/right_sidebar.css+++ b/web/styles/right_sidebar.css@@ -323,6 +323,7 @@.selectable_sidebar_block {margin: 4px;+ margin-left: var(--right-sidebar-header-icon-toggle-width);}.avatar-preload-background {@@ -416,13 +417,15 @@"row-content ." auto / minmax(0, 1fr) var(--right-sidebar-vdots-width);align-content: baseline;margin-right: var(--width-simplebar-scroll-hover);- margin-left: var(--right-sidebar-toggle-width-offset);/* When both the left circle and three dot menu are present, we wantthe space to the left of the circle to be more similar to the spaceto the right of the three dot menu. */&:not(.with_avatar) {- padding-left: 2px;- margin-left: calc(var(--right-sidebar-toggle-width-offset) - 2px);+ padding-left: calc(var(--right-sidebar-toggle-width-offset) - 2px);+ }++ &:hover {+ cursor: pointer;}.user-name-and-status-emoji {