Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

buddy_list: Don't go to DM narrow on avatar click.

evykassirerce7c3705f70f
diff --git a/web/e2e-tests/message-basics.test.ts b/web/e2e-tests/message-basics.test.ts
index eceed790baf..0102867957d 100644
--- a/web/e2e-tests/message-basics.test.ts
+++ b/web/e2e-tests/message-basics.test.ts
@@ -404,21 +404,21 @@ async function test_stream_search_filters_stream_list(page: Page): Promise<void>
async function test_users_search(page: Page): Promise<void> {
console.log("Search users using right sidebar");
async function assert_in_list(page: Page, name: string): Promise<void> {
- await page.waitForSelector(`#buddy-list-other-users li [data-name="${CSS.escape(name)}"]`, {
+ await page.waitForSelector(`#buddy-list-other-users li[data-name="${CSS.escape(name)}"]`, {
visible: true,
});
}
async function assert_selected(page: Page, name: string): Promise<void> {
await page.waitForSelector(
- `#buddy-list-other-users li.highlighted_user [data-name="${CSS.escape(name)}"]`,
+ `#buddy-list-other-users li.highlighted_user[data-name="${CSS.escape(name)}"]`,
{visible: true},
);
}
async function assert_not_selected(page: Page, name: string): Promise<void> {
await page.waitForSelector(
- `#buddy-list-other-users li.highlighted_user [data-name="${CSS.escape(name)}"]`,
+ `#buddy-list-other-users li.highlighted_user[data-name="${CSS.escape(name)}"]`,
{hidden: true},
);
}
@@ -452,7 +452,7 @@ async function test_users_search(page: Page): Promise<void> {
await arrow(page, "Down");
// Now Iago must be highlighted
- await page.waitForSelector('#buddy-list-other-users li.highlighted_user [data-name="Iago"]', {
+ await page.waitForSelector('#buddy-list-other-users li.highlighted_user[data-name="Iago"]', {
visible: true,
});
await assert_not_selected(page, "King Hamlet");
diff --git a/web/src/click_handlers.js b/web/src/click_handlers.js
index 75fe846133f..5ceb2472e56 100644
--- a/web/src/click_handlers.js
+++ b/web/src/click_handlers.js
@@ -440,6 +440,9 @@ export function initialize() {
if (e.metaKey || e.ctrlKey || e.shiftKey) {
return;
}
+ if ($(e.target).parents(".user-profile-picture").length === 1) {
+ return;
+ }
const $li = $(e.target).parents("li");
diff --git a/web/styles/right_sidebar.css b/web/styles/right_sidebar.css
index b0762dc092e..7ac8c507dcf 100644
--- a/web/styles/right_sidebar.css
+++ b/web/styles/right_sidebar.css
@@ -255,6 +255,7 @@ $user_status_emoji_width: 24px;
}
.user_sidebar_entry.with_avatar .selectable_sidebar_block {
+ margin: 3px;
grid-template:
"row-content markers-and-controls" var(--line-height-sidebar-row-with-avatars)
"row-content ." auto / minmax(0, 1fr)
@@ -272,7 +273,7 @@ $user_status_emoji_width: 24px;
}
.information-settings .profile-with-avatar,
-.user_sidebar_entry.with_avatar .user-presence-link {
+.user_sidebar_entry.with_avatar .selectable_sidebar_block {
line-height: var(--line-height-sidebar-row-with-avatars);
display: grid;
grid-template: "avatar row-content" var(--right-sidebar-avatar-width) / auto minmax(
@@ -287,10 +288,6 @@ $user_status_emoji_width: 24px;
margin: 5px 0;
}
-.user_sidebar_entry.with_avatar .user-presence-link {
- margin: 3px;
-}
-
.my_user_status {
opacity: 0.5;
white-space: nowrap;
diff --git a/web/templates/presence_row.hbs b/web/templates/presence_row.hbs
index b1cce8cdd4f..abb5f893df8 100644
--- a/web/templates/presence_row.hbs
+++ b/web/templates/presence_row.hbs
@@ -1,11 +1,8 @@
-<li data-user-id="{{user_id}}" class="user_sidebar_entry {{#if user_list_style.WITH_AVATAR}}with_avatar{{/if}} {{#if is_current_user}}user_sidebar_entry_me {{/if}} narrow-filter {{#if faded}} user-fade {{/if}}">
+<li data-user-id="{{user_id}}" data-name="{{name}}" class="user_sidebar_entry {{#if user_list_style.WITH_AVATAR}}with_avatar{{/if}} {{#if is_current_user}}user_sidebar_entry_me {{/if}} narrow-filter {{#if faded}} user-fade {{/if}}">
<div class="selectable_sidebar_block">
- {{#unless user_list_style.WITH_AVATAR}}<span class="{{user_circle_class}} user_circle"></span>{{/unless}}
- <a class="user-presence-link"
- href="{{href}}"
- data-user-id="{{user_id}}"
- data-name="{{name}}">
- {{#if user_list_style.WITH_STATUS}}
+ {{#if user_list_style.WITH_STATUS}}
+ <span class="{{user_circle_class}} user_circle"></span>
+ <a class="user-presence-link" href="{{href}}">
<div class="user-name-and-status-wrapper">
<div class="user-name-and-status-emoji">
{{> user_full_name}}
@@ -13,11 +10,13 @@
</div>
<span class="status-text">{{status_text}}</span>
</div>
- {{else if user_list_style.WITH_AVATAR}}
- <div class="user-profile-picture">
- <img loading="lazy" src="{{profile_picture}}"/>
- <span class="{{user_circle_class}} user_circle"></span>
- </div>
+ </a>
+ {{else if user_list_style.WITH_AVATAR}}
+ <div class="user-profile-picture">
+ <img loading="lazy" src="{{profile_picture}}"/>
+ <span class="{{user_circle_class}} user_circle"></span>
+ </div>
+ <a class="user-presence-link" href="{{href}}">
<div class="user-name-and-status-wrapper">
<div class="user-name-and-status-emoji">
{{> user_full_name}}
@@ -25,13 +24,16 @@
</div>
<span class="status-text">{{status_text}}</span>
</div>
- {{else}}
+ </a>
+ {{else}}
+ <span class="{{user_circle_class}} user_circle"></span>
+ <a class="user-presence-link" href="{{href}}">
<div class="user-name-and-status-emoji">
{{> user_full_name}}
{{> status_emoji status_emoji_info}}
</div>
- {{/if}}
- </a>
+ </a>
+ {{/if}}
<span class="unread_count {{#unless num_unread}}hide{{/unless}}">{{#if num_unread}}{{num_unread}}{{/if}}</span>
</div>
<span class="sidebar-menu-icon user-list-sidebar-menu-icon"><i class="zulip-icon zulip-icon-more-vertical" aria-hidden="true"></i></span>