Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
recent_view: Redesign table.
Aman Agrawal7ef85370ba31
diff --git a/web/src/click_handlers.ts b/web/src/click_handlers.tsindex 3c7c8c8f360..13b315b4e97 100644--- a/web/src/click_handlers.ts+++ b/web/src/click_handlers.ts@@ -814,7 +814,7 @@ export function initialize(): void {// Recent conversations direct messages (Not displayed on small widths)$("body").on("mouseenter",- ".recent_topic_stream .pm_status_icon",+ ".recent_topic_name .pm_status_icon",function (this: HTMLElement, e) {e.stopPropagation();const $elem = $(this);diff --git a/web/src/recent_view_ui.ts b/web/src/recent_view_ui.tsindex ab30ce24d7a..86910acc496 100644--- a/web/src/recent_view_ui.ts+++ b/web/src/recent_view_ui.ts@@ -20,6 +20,7 @@ import * as dropdown_widget from "./dropdown_widget.ts";import type {DropdownWidget} from "./dropdown_widget.ts";import * as hash_util from "./hash_util.ts";import {$t, $t_html} from "./i18n.ts";+import * as keydown_util from "./keydown_util.ts";import * as left_sidebar_navigation_area from "./left_sidebar_navigation_area.ts";import * as list_widget from "./list_widget.ts";import type {ListWidget} from "./list_widget.ts";@@ -42,7 +43,6 @@ import * as stream_topic_history from "./stream_topic_history.ts";import * as sub_store from "./sub_store.ts";import * as timerender from "./timerender.ts";import * as typeahead from "./typeahead.ts";-import * as ui_util from "./ui_util.ts";import * as unread from "./unread.ts";import {user_settings} from "./user_settings.ts";import * as user_status from "./user_status.ts";@@ -82,10 +82,9 @@ export let $current_focus_elem: JQuery | "table" = "table";let last_visited_topic: string | undefined;export const COLUMNS = {- stream: 0,- topic: 1,- read: 2,- mute: 3,+ topic: 0,+ read: 1,+ mute: 2,};let row_focus = 0;@@ -96,8 +95,8 @@ let col_focus = COLUMNS.topic;// Used to implement wraparound of elements with the right/left keys.// Must be increased when we add new actions, or rethought if we add// optional actions that only appear in some rows.-const MAX_SELECTABLE_TOPIC_COLS = 4;-const MAX_SELECTABLE_DIRECT_MESSAGE_COLS = 3;+const MAX_SELECTABLE_TOPIC_COLS = 3;+const MAX_SELECTABLE_DIRECT_MESSAGE_COLS = 2;// we use localstorage to persist the recent topic filtersconst ls_key = "recent_topic_filters";@@ -331,7 +330,7 @@ function set_table_focus(row: number, col: number, using_keyboard = false): boolconst $topic_row = $topic_rows.eq(row);// We need to allow table to render first before setting focus.setTimeout(- () => $topic_row.find(".recent_view_focusable").eq(col).children().trigger("focus"),+ () => $topic_row.find(".recent_view_focusable").addBack().eq(col).trigger("focus"),0,);$current_focus_elem = "table";@@ -364,11 +363,11 @@ function set_table_focus(row: number, col: number, using_keyboard = false): bool};}} else {- const stream_name = $topic_row.find(".recent_topic_stream a").text();+ const stream_name = $topic_row.find(".recent-view-channel-name").text();const stream = stream_data.get_sub_by_name(stream_name);reply_recipient_information = {stream_id: stream?.stream_id,- topic: $topic_row.find(".recent_topic_name a").text(),+ topic: $topic_row.find(".recent-view-conversation-link").text(),};}compose_closed_ui.update_recipient_text_for_reply_button(reply_recipient_information);@@ -1154,7 +1153,7 @@ function sort_comparator(a: string, b: string): number {return -1;}-function stream_sort(a: Row, b: Row): number {+function conversation_sort(a: Row, b: Row): number {if (a.type === b.type) {const a_msg = message_store.get(a.last_msg_id);assert(a_msg !== undefined);@@ -1165,6 +1164,10 @@ function stream_sort(a: Row, b: Row): number {assert(b_msg.type === "stream");const a_stream_name = stream_data.get_stream_name_from_id(a_msg.stream_id);const b_stream_name = stream_data.get_stream_name_from_id(b_msg.stream_id);++ if (a_stream_name === b_stream_name) {+ return sort_comparator(a_msg.topic, b_msg.topic);+ }return sort_comparator(a_stream_name, b_stream_name);}assert(a_msg.type === "private");@@ -1175,19 +1178,6 @@ function stream_sort(a: Row, b: Row): number {return sort_comparator(a.type, b.type);}-function topic_sort_key(conversation_data: ConversationData): string {- const message = message_store.get(conversation_data.last_msg_id);- assert(message !== undefined);- if (message.type === "private") {- return message.display_reply_to;- }- return message.topic;-}--function topic_sort(a: ConversationData, b: ConversationData): number {- return sort_comparator(topic_sort_key(a), topic_sort_key(b));-}-function unread_count(conversation_data: ConversationData): number {const message = message_store.get(conversation_data.last_msg_id);assert(message !== undefined);@@ -1369,8 +1359,7 @@ export function complete_rerender(coming_from_other_views = false): void {},},sort_fields: {- stream_sort,- topic_sort,+ conversation_sort,unread_sort,...list_widget.generic_sort_functions("numeric", ["last_msg_id"]),},@@ -1911,7 +1900,26 @@ export function initialize({}});- $("body").on("keydown", ".on_hover_topic_read", ui_util.convert_enter_to_click);+ $("body").on("keydown", ".recent-view-body-row", (e) => {+ if (keydown_util.is_enter_event(e)) {+ e.preventDefault();+ e.stopPropagation();++ switch (col_focus) {+ case COLUMNS.topic:+ $(e.currentTarget).find(".recent-view-conversation-link").trigger("click");+ break;+ case COLUMNS.read:+ $(e.currentTarget).find(".on_hover_topic_read").trigger("click");+ break;+ case COLUMNS.mute:+ $(e.currentTarget)+ .find(".recent_view_focusable .visibility-status-icon")+ .trigger("click");+ break;+ }+ }+ });$("body").on("click", ".button-recent-filters", function (this: HTMLElement, e) {e.stopPropagation();@@ -1937,14 +1945,16 @@ export function initialize({change_focused_element($(e.currentTarget), "click");});- $("body").on("click", "td.recent_topic_stream", (e) => {+ $("body").on("click", "td.recent-view-channel-name", (e) => {if (e.metaKey || e.ctrlKey || e.shiftKey) {return;}e.stopPropagation();const topic_row_index = $(e.target).closest("tr").index();- focus_clicked_element(topic_row_index, COLUMNS.stream);+ // Focus topic on channel click since we don't have+ // separate column for channel and topic.+ focus_clicked_element(topic_row_index, COLUMNS.topic);window.location.href = $(e.currentTarget).find("a").attr("href")!;});diff --git a/web/styles/recent_view.css b/web/styles/recent_view.cssindex ca319d1a6ba..2b5d74d8b02 100644--- a/web/styles/recent_view.css+++ b/web/styles/recent_view.css@@ -44,56 +44,62 @@& td {box-sizing: border-box;vertical-align: middle;- padding: 3px 8px;+ padding: 0.1875em 0.5em; /* 3px 8px at 16px/1em */++ @media (width < $md_min) {+ padding: 0.375em 0.5em; /* 6px 8px at 16px/1em */+ }}.recent_view_focusable {- /* Use flexbox to align icons vertically */- display: flex;- align-items: center;-- .recent-view-table-link,& > .zulip-icon {outline: 0;}- &:focus-within {- /* Use the same color as the message feed pointer */- box-shadow: 0 3px 0 var(--color-outline-focus);+ &:focus {+ outline: 2px solid var(--color-outline-focus);++ > .change_visibility_policy .recent-view-row-topic-menu {+ opacity: 0.2;+ }}- &.change_visibility_policy.topic-popover-visible {+ > .change_visibility_policy.topic-popover-visible {.visibility-status-icon {opacity: 0.4;}}- &.change_visibility_policy+ &.recent-view-topic-visibility {+ border-radius: 0.3125em; /* 5px at 16px/1em */+ outline-offset: 0.3125em; /* 5px at 16px/1em */+ }++ > .change_visibility_policy {+ display: flex;+.visibility-status-icon:not(.recent-view-row-topic-menu):hover {- /* Show vertical ellipsis when user hovers over visibility indicator icon. */- background-image: url("../icons/more-vertical.svg");- background-repeat: no-repeat;- background-position: left bottom;- background-size: contain;- width: var(--base-font-size-px);- height: var(--base-font-size-px);-- &::before {- content: "";+ /* Show vertical ellipsis when user hovers over visibility indicator icon. */+ background-image: url("../icons/more-vertical.svg");+ background-repeat: no-repeat;+ background-position: left bottom;+ background-size: contain;+ width: var(--base-font-size-px);+ height: var(--base-font-size-px);++ &::before {+ content: "";+ }}}- &.change_visibility_policy .recent-view-row-topic-menu {+ > .change_visibility_policy .recent-view-row-topic-menu {opacity: 0;cursor: pointer;&:not(.visibility-status-icon) {display: none;}-- &:focus {- opacity: 0.2;- }}}@@ -102,10 +108,6 @@text-decoration: none;}- .white-space-preserve-wrap {- overflow-wrap: anywhere;- }-.empty-table-message {background-color: var(--color-background);padding: 3em 1em;@@ -255,23 +257,12 @@visibility: hidden;}- .flex_container_pm {- /* Flex container to fit in user circle and group icon */- display: flex;- justify-content: space-between;-- .tippy-content {- font-weight: 400;- }- }-.flex_container {display: flex;align-items: center;}- .flex_container .right_part {- margin-left: auto;+ .inline-flex-container {display: inline-flex;align-items: center;}@@ -296,16 +287,6 @@visibility: hidden;}- .recent_topic_actions .recent_view_focusable {- /* Keep a uniform distance from the focus-within- indicator at bottom. */- padding-bottom: 3px;- /* But push down with margin by the same amount,- so as to preserve vertical alignment introduced- by the parent flexbox. */- margin-top: 3px;- }-.recent_topic_actions .recipient_bar_icon {/* Zero out padding used in recipient bar. */padding-right: 0;@@ -333,6 +314,11 @@backwards, which super janky.*/flex-direction: row-reverse;++ &:first-child {+ /* Remove padding of first child to align with header text. */+ padding-left: 0;+ }}.recent_view_participant_item {@@ -457,21 +443,17 @@);transition: background-color 100ms ease-in-out;}- }-- .recent_topic_stream,- .recent-view-stream-header {- width: 25%;- }- .recent-view-topic-header {- width: 33%;+ .zulip-icon-chevron-right {+ font-size: 1em; /* 15px at 15px/1em */+ align-self: center;+ color: hsl(0deg 0% 60%);+ padding: 0 0.33em; /* 5px at 15px/1em */+ }}.recent-view-unread-header {width: 7%;- /* 64px at 20px/1em */- min-width: 3.2em;}.recent_topic_users,@@ -481,59 +463,58 @@.recent_topic_timestamp,.recent-view-last-msg-time-header {- width: 15%;+ width: 20%;}- /* These fixed column widths prevent column widths from being adjusted- as new messages arrive from the server. */- .recent_topic_stream {- padding: 8px 0 8px 8px;+ .recent_topic_name {+ padding-left: 0.625em; /* 10px at 16px/1em */- .recent_view_focusable {- display: grid;- grid-template-areas: "starting-anchor-element row-content";- /* 14px at 14px/1em */- grid-template-columns: 1em minmax(0, 1fr);- /* Visually match the 8px of padding to- the left of the filter icon. */- gap: 7px;- place-content: center center;- /* Visually match the 8px of padding around the- filter icon, and keep DM icons from colliding- with the "Direct messages" text. */- margin-right: 9px;+ .recent-view-conversation-wrapper {+ display: flex;+ align-items: flex-start;+ gap: 8px;+ width: 100%;+ box-sizing: border-box;}- & a {- overflow-wrap: anywhere;- hyphens: auto;+ .zulip-icon-chevron-right {+ font-size: 0.9375em; /* 15px at 16px/1em */+ vertical-align: middle;+ color: hsl(0deg 0% 60%);+ padding: 0 0.125em; /* 2px at 16px/1em */}- }- .recent_topic_name {- width: 40%;-- .line_clamp {- /* This -webkit-box display property is webkit-specific, but- it appears that line clamping works fine for this component- on Firefox anyway. */- /* stylelint-disable-next-line value-no-vendor-prefix */- display: -webkit-box;- -webkit-line-clamp: 2;- -webkit-box-orient: vertical;+ .recent-view-channel-icon-wrapper {+ flex-shrink: 0;+ display: flex;+ align-items: center;+ justify-content: center;+ margin-top: 0.1875em; /* 3px at 16px/1em */+ padding-right: 0.4375em;+ }++ .recent-view-dm-name,+ .recent-view-channel-name {+ display: inline-block;+ max-width: 100%;+ vertical-align: bottom;+ white-space: nowrap;overflow: hidden;+ text-overflow: ellipsis;}- /* We don't want to apply line clamping to 1:1 DMs,- as that causes an odd problem with Safari collapsing- the grid on .user-status-microlayout so that usernames- always have an ellipsis--no matter how short they are,- nor how much space is available in the Topic column.+ .recent-view-topic-wrapper {+ /* Start at 0 width and grow to take remaining space.+ Without this, long topic names push unread count+ below the participant avatars.+ See: https://css-tricks.com/flex-grow-is-weird/+ */+ width: 0;+ flex-grow: 1;+ }- `display: inherit` here will set the value to what is- already established on .recent_view_focusable. */- .line_clamp:has(.recent-view-dm) {- display: inherit;+ .recent-view-conversation-link {+ display: inline;}}@@ -562,15 +543,13 @@margin-right: 5px;font-size: 1.0714em; /* 15px at 14px / em */}- }- .private_conversation_row {- .recent_topic_stream {- /* Reduce padding of stream section so that user status- icon can have more padding without impacting height of the row */- padding: 5px 0 5px 8px;+ .recent-view-unread-header {+ width: 15%;}+ }+ .private_conversation_row {.pm_status_icon {display: flex;justify-content: center;@@ -585,9 +564,11 @@min-width: var(--length-user-status-circle-recent-conversations);- font-size: 0.625em;+ font-size: 0.625em; /* 10px at 16px/1em */float: left;position: unset;+ /* Make the width 16px to match other icons. */+ padding: 0 0.3em; /* 3px at 10/1em */}}@@ -604,13 +585,6 @@}}}-- .stream-privacy .zulip-icon {- /* Let flexbox handle vertical alignment by- pushing back against inline-block display. */- display: block;- text-align: center;- }}#recent_view_bottom_whitespace {@@ -655,3 +629,33 @@box-shadow: 0 0 5px var(--color-box-shadow-input-focus);}}++#recent_view .recent_topic_timestamp .flex_container {+ justify-content: space-between;++ /* To avoid time text from wrapping, keep extra margin+ as small as possible. */+ .recent_topic_actions {+ margin-right: 0.125em; /* 2px at 16px/1em */+ }+}++.recent-view-unread-mention-and-count-wrapper {+ display: flex;+ align-items: center;+ margin-left: auto;+ flex-direction: row;+}++.unread_sort .recent-view-header-wrapper {+ justify-content: flex-end;+}++.recent-view-body-row {+ outline-offset: -0.25em; /* -4px at 16px/1em */+ border-radius: 0.625em; /* 10px at 16px/1em */+}++.recent-view-table-unread-count {+ border-radius: 0.3125em; /* 5px at 16px/1em */+}diff --git a/web/templates/recent_view_row.hbs b/web/templates/recent_view_row.hbsindex 5b96a237c51..9d306c77684 100644--- a/web/templates/recent_view_row.hbs+++ b/web/templates/recent_view_row.hbs@@ -1,81 +1,52 @@-<tr id="recent_conversation:{{conversation_key}}" class="{{#unless (eq unread_count 0)}}unread_topic{{/unless}} {{#if is_private}}private_conversation_row{{/if}}">- <td class="recent_topic_stream">- <div class="flex_container flex_container_pm">- <div class="left_part recent_view_focusable" data-col-index="{{ column_indexes.stream }}">- {{#if is_private}}- <span class="zulip-icon zulip-icon-user"></span>- <a href="{{pm_url}}" class="recent-view-table-link">{{t "Direct messages" }}</a>- {{else}}- <span class="stream-privacy-original-color-{{stream_id}} stream-privacy filter-icon" style="color: {{stream_color}}">- {{> stream_privacy . }}- </span>- <a href="{{topic_url}}" class="recent-view-table-link">{{stream_name}}</a>- {{/if}}- </div>- {{!-- For presence/group indicator --}}- {{#if is_private}}- <div class="right_part">- <span class="pm_status_icon {{#unless is_group}}show-tooltip{{/unless}}" data-tippy-placement="top" data-user-ids-string="{{user_ids_string}}">- {{#if is_group}}- <span class="conversation-partners-icon zulip-icon zulip-icon-dm-groups-3"></span>- {{else if is_bot}}- <span class="zulip-icon zulip-icon-bot" aria-hidden="true"></span>+<tr id="recent_conversation:{{conversation_key}}" class="{{#unless (eq unread_count 0)}}unread_topic{{/unless}} {{#if is_private}}private_conversation_row{{/if}} recent-view-body-row recent_view_focusable" data-col-index="{{ column_indexes.topic }}" tabindex="0">+ {{!-- TODO: Rename recent_topic_name to recent-view-conversation-column--}}+ <td class="recent_topic_name">+ <div class="flex_container">+ <div class="recent-view-conversation-wrapper">+ <div class="recent-view-channel-icon-wrapper">+ {{#if is_private}}+ {{!-- For presence/group indicator --}}+ <span class="pm_status_icon {{#unless is_group}}show-tooltip{{/unless}}" data-tippy-placement="top" data-user-ids-string="{{user_ids_string}}">+ {{#if is_group}}+ <span class="conversation-partners-icon zulip-icon zulip-icon-dm-groups-3"></span>+ {{else if is_bot}}+ <span class="zulip-icon zulip-icon-bot" aria-hidden="true"></span>+ {{else}}+ <span class="zulip-icon zulip-icon-{{user_circle_class}} {{user_circle_class}} user-circle" data-presence-indicator-user-id="{{user_ids_string}}"></span>+ {{/if}}+ </span>{{else}}- <span class="zulip-icon zulip-icon-{{user_circle_class}} {{user_circle_class}} user-circle" data-presence-indicator-user-id="{{user_ids_string}}"></span>+ <span class="stream-privacy-original-color-{{stream_id}} stream-privacy filter-icon" style="color: {{stream_color}}">+ {{> stream_privacy . }}+ </span>{{/if}}- </span>- </div>- {{/if}}- </div>- </td>- <td class="recent_topic_name"{{#if (not is_spectator) }} colspan="2"{{/if}}>- <div class="flex_container">- <div class="left_part recent_view_focusable line_clamp" data-col-index="{{ column_indexes.topic }}">- {{#if is_private}}- <a href="{{pm_url}}" class="recent-view-table-link {{#if is_group}}recent-view-dm-group{{else}}recent-view-dm{{/if}}">{{{rendered_pm_with_html}}}</a>- {{else}}- <a class="white-space-preserve-wrap recent-view-table-link {{#if is_empty_string_topic}}empty-topic-display{{/if}}" href="{{topic_url}}">{{topic_display_name}}</a>- {{/if}}+ </div>+ <div class="recent-view-topic-wrapper">+ {{#if is_private}}+ <a href="{{pm_url}}" class="recent-view-dm-name recent-view-table-link" tabindex="-1">{{t "DM" }}</a>+ {{else}}+ <a href="{{topic_url}}" class="recent-view-channel-name recent-view-table-link" tabindex="-1">{{stream_name}}</a>+ {{/if}}+ <i class="zulip-icon zulip-icon-chevron-right"></i>+ {{#if is_private}}+ <a href="{{pm_url}}" class="recent-view-conversation-link recent-view-table-link {{#if is_group}}recent-view-dm-group{{else}}recent-view-dm{{/if}}" tabindex="-1">{{{rendered_pm_with_html}}}</a>+ {{else}}+ <a class="recent-view-conversation-link recent-view-table-link {{#if is_empty_string_topic}}empty-topic-display{{/if}}" href="{{topic_url}}" tabindex="-1">{{topic_display_name}}</a>+ {{/if}}+ </div></div>- <div class="right_part">+ <div class="recent-view-unread-mention-and-count-wrapper">{{#if is_private}}<span class="unread_mention_info tippy-zulip-tooltip {{#unless has_unread_mention}}unread_hidden{{/unless}}"data-tippy-content="{{t 'You have unread mentions' }}">@</span>- <div class="recent_topic_actions">- <div class="recent_view_focusable" data-col-index="{{ column_indexes.read }}">- <span class="unread_count unread_count_pm recent-view-table-unread-count {{#if (eq unread_count 0)}}unread_hidden{{/if}} tippy-zulip-tooltip on_hover_topic_read" data-user-ids-string="{{user_ids_string}}" data-tippy-content="{{t 'Mark as read' }}" role="button" tabindex="0" aria-label="{{t 'Mark as read' }}">{{unread_count}}</span>- </div>- </div>- <div class="recent_topic_actions dummy_action_button">- <div class="recent_view_focusable" data-col-index="{{ column_indexes.read }}">- {{!-- Invisible icon, used only for alignment of unread count. --}}- <i class="zulip-icon zulip-icon-mute on_hover_topic_unmute recipient_bar_icon"></i>- </div>+ <div class="recent_topic_actions recent-view-unread-count-wrapper">+ <span class="unread_count unread_count_pm recent-view-table-unread-count recent_view_focusable {{#if (eq unread_count 0)}}unread_hidden{{/if}} tippy-zulip-tooltip on_hover_topic_read" data-user-ids-string="{{user_ids_string}}" data-tippy-content="{{t 'Mark as read' }}" role="button" aria-label="{{t 'Mark as read' }}" data-col-index="{{ column_indexes.read }}" tabindex="0">{{unread_count}}</span></div>{{else}}<span class="unread_mention_info tippy-zulip-tooltip {{#unless mention_in_unread}}unread_hidden{{/unless}}"data-tippy-content="{{t 'You have unread mentions'}}">@</span>- <div class="recent_topic_actions">- <div class="recent_view_focusable hidden-for-spectators" data-col-index="{{ column_indexes.read }}">- <span class="unread_count recent-view-table-unread-count {{#if (eq unread_count 0)}}unread_hidden{{/if}} tippy-zulip-tooltip on_hover_topic_read" data-stream-id="{{stream_id}}" data-topic-name="{{topic}}" data-tippy-content="{{t 'Mark as read' }}" role="button" tabindex="0" aria-label="{{t 'Mark as read' }}">{{unread_count}}</span>- </div>- </div>- <div class="recent_topic_actions">- <div class="hidden-for-spectators">- {{#unless is_archived}}- <span class="recent_view_focusable change_visibility_policy hidden-for-spectators" data-stream-id="{{stream_id}}" data-topic-name="{{topic}}" data-col-index="{{ column_indexes.mute }}">- {{#if (eq visibility_policy all_visibility_policies.FOLLOWED)}}- <i class="zulip-icon zulip-icon-follow recipient_bar_icon visibility-status-icon" tabindex="0" aria-label="{{t 'Topic actions menu' }}" aria-haspopup="true" data-stream-id="{{stream_id}}" data-topic-name="{{topic}}" data-topic-url="{{topic_url}}" data-tippy-content="{{t 'You follow this topic.'}}" role="button"></i>- {{else if (eq visibility_policy all_visibility_policies.UNMUTED)}}- <i class="zulip-icon zulip-icon-unmute recipient_bar_icon visibility-status-icon" tabindex="0" aria-label="{{t 'Topic actions menu' }}" aria-haspopup="true" data-stream-id="{{stream_id}}" data-topic-name="{{topic}}" data-topic-url="{{topic_url}}" data-tippy-content="{{t 'You have unmuted this topic.'}}" role="button"></i>- {{else if (eq visibility_policy all_visibility_policies.MUTED)}}- <i class="zulip-icon zulip-icon-mute recipient_bar_icon visibility-status-icon" tabindex="0" aria-label="{{t 'Topic actions menu' }}" aria-haspopup="true" data-stream-id="{{stream_id}}" data-topic-name="{{topic}}" data-topic-url="{{topic_url}}" data-tippy-content="{{t 'You have muted this topic.'}}" role="button"></i>- {{else}}- <i class="zulip-icon zulip-icon-more-vertical recent-view-row-topic-menu visibility-status-icon" tabindex="0" aria-label="{{t 'Topic actions menu' }}" aria-haspopup="true" data-stream-id="{{stream_id}}" data-topic-name="{{topic}}" data-topic-url="{{topic_url}}" role="button"></i>- {{/if}}- </span>- {{/unless}}- </div>+ <div class="recent_topic_actions recent-view-unread-count-wrapper">+ <span class="unread_count recent-view-table-unread-count hidden-for-spectators recent_view_focusable {{#if (eq unread_count 0)}}unread_hidden{{/if}} tippy-zulip-tooltip on_hover_topic_read" data-stream-id="{{stream_id}}" data-topic-name="{{topic}}" data-tippy-content="{{t 'Mark as read' }}" role="button" aria-label="{{t 'Mark as read' }}" data-col-index="{{ column_indexes.read }}" tabindex="0">{{unread_count}}</span></div>{{/if}}</div>@@ -103,8 +74,27 @@</ul></td><td class="recent_topic_timestamp">- <div class="last_msg_time tippy-zulip-tooltip" data-tippy-content="{{this.full_last_msg_date_time}}">- <a class="last-msg-link" href="{{last_msg_url}}" tabindex="-1">{{ last_msg_time }}</a>+ <div class="flex_container">+ <div class="last_msg_time tippy-zulip-tooltip" data-tippy-content="{{this.full_last_msg_date_time}}">+ <a class="last-msg-link" href="{{last_msg_url}}" tabindex="-1">{{ last_msg_time }}</a>+ </div>+ {{#unless is_private}}+ <div class="recent_topic_actions hidden-for-spectators recent_view_focusable recent-view-topic-visibility" data-col-index="{{ column_indexes.mute }}" tabindex="0">+ {{#unless is_archived}}+ <span class="change_visibility_policy" data-stream-id="{{stream_id}}" data-topic-name="{{topic}}">+ {{#if (eq visibility_policy all_visibility_policies.FOLLOWED)}}+ <i class="zulip-icon zulip-icon-follow recipient_bar_icon visibility-status-icon" aria-label="{{t 'Topic actions menu' }}" aria-haspopup="true" data-stream-id="{{stream_id}}" data-topic-name="{{topic}}" data-topic-url="{{topic_url}}" data-tippy-content="{{t 'You follow this topic.'}}" role="button"></i>+ {{else if (eq visibility_policy all_visibility_policies.UNMUTED)}}+ <i class="zulip-icon zulip-icon-unmute recipient_bar_icon visibility-status-icon" aria-label="{{t 'Topic actions menu' }}" aria-haspopup="true" data-stream-id="{{stream_id}}" data-topic-name="{{topic}}" data-topic-url="{{topic_url}}" data-tippy-content="{{t 'You have unmuted this topic.'}}" role="button"></i>+ {{else if (eq visibility_policy all_visibility_policies.MUTED)}}+ <i class="zulip-icon zulip-icon-mute recipient_bar_icon visibility-status-icon" aria-label="{{t 'Topic actions menu' }}" aria-haspopup="true" data-stream-id="{{stream_id}}" data-topic-name="{{topic}}" data-topic-url="{{topic_url}}" data-tippy-content="{{t 'You have muted this topic.'}}" role="button"></i>+ {{else}}+ <i class="zulip-icon zulip-icon-more-vertical recent-view-row-topic-menu visibility-status-icon" aria-label="{{t 'Topic actions menu' }}" aria-haspopup="true" data-stream-id="{{stream_id}}" data-topic-name="{{topic}}" data-topic-url="{{topic_url}}" role="button"></i>+ {{/if}}+ </span>+ {{/unless}}+ </div>+ {{/unless}}</div></td></tr>diff --git a/web/templates/recent_view_table.hbs b/web/templates/recent_view_table.hbsindex 37a81698e24..9debb769f17 100644--- a/web/templates/recent_view_table.hbs+++ b/web/templates/recent_view_table.hbs@@ -11,15 +11,11 @@<table class="table table-responsive"><thead id="recent-view-table-headers"><tr>- <th class="recent-view-stream-header" data-sort="stream_sort">+ <th class="recent-view-topic-header" data-sort="conversation_sort"><div class="recent-view-header-wrapper"><span>{{t 'Channel' }}</span>- <i class="table-sortable-arrow zulip-icon zulip-icon-sort-arrow-down"></i>- </div>- </th>- <th class="recent-view-topic-header" data-sort="topic_sort">- <div class="recent-view-header-wrapper">- <span>{{t 'Topic' }}</span>+ <i class="zulip-icon zulip-icon-chevron-right"></i>+ <span>{{t 'Conversation' }}</span><i class="table-sortable-arrow zulip-icon zulip-icon-sort-arrow-down"></i></div></th>diff --git a/web/tests/recent_view.test.cjs b/web/tests/recent_view.test.cjsindex 91715c62e52..4866c56d9c3 100644--- a/web/tests/recent_view.test.cjs+++ b/web/tests/recent_view.test.cjs@@ -71,12 +71,9 @@ const ListWidget = mock_esm("../src/list_widget", {// Just for coverage, the mechanisms// are tested in list_widget.test.cjsif (mapped_topic_values.length >= 2) {- opts.sort_fields.stream_sort(mapped_topic_values[0], mapped_topic_values[1]);- opts.sort_fields.stream_sort(mapped_topic_values[1], mapped_topic_values[0]);- opts.sort_fields.stream_sort(mapped_topic_values[0], mapped_topic_values[0]);- opts.sort_fields.topic_sort(mapped_topic_values[0], mapped_topic_values[1]);- opts.sort_fields.topic_sort(mapped_topic_values[1], mapped_topic_values[0]);- opts.sort_fields.topic_sort(mapped_topic_values[0], mapped_topic_values[0]);+ opts.sort_fields.conversation_sort(mapped_topic_values[0], mapped_topic_values[1]);+ opts.sort_fields.conversation_sort(mapped_topic_values[1], mapped_topic_values[0]);+ opts.sort_fields.conversation_sort(mapped_topic_values[0], mapped_topic_values[0]);}return ListWidget;},@@ -199,6 +196,7 @@ mock_esm("../src/unread", {});mock_esm("../src/resize", {update_recent_view: noop,+ set_recent_view_participants_rerender: noop,});mock_esm("../src/popup_banners", {close_found_missing_unreads_banner: noop,