recent view: Rename topics to conversations in code comments.

This commit is contained in:
evykassirer 2023-09-06 14:04:07 -07:00 committed by Tim Abbott
parent bfc6282d4f
commit 1e9bb82068
16 changed files with 37 additions and 36 deletions

View File

@ -160,7 +160,7 @@ export function initialize() {
// When the message selection changes, change the label on the Reply button.
$(document).on("message_selected.zulip", () => {
if (narrow_state.is_message_feed_visible()) {
// message_selected events can occur with recent topics
// message_selected events can occur with Recent Conversations
// open due to "All messages" loading in the background,
// so we only update if message feed is visible.
update_reply_recipient_label();

View File

@ -241,11 +241,12 @@ export function process_escape_key(e) {
if (
recent_topics_ui.is_in_focus() &&
// This will return false if `e.target` is not
// any of the recent topics elements by design.
// any of the Recent Conversations elements by design.
recent_topics_ui.change_focused_element($(e.target), "escape")
) {
// Recent topics uses escape to switch focus from RT search / filters to topics table.
// If focus is already on the table it returns false.
// Recent Conversations uses escape to switch focus from
// search / filters to the conversations table. If focus is
// already on the table, it returns false.
return true;
}
@ -484,10 +485,10 @@ export function process_enter_key(e) {
if (recent_topics_util.is_visible()) {
if (e.target === $("body")[0]) {
// There's a race when using `Esc` and `Enter` to navigate to
// Recent Topics and then navigate to the next topic, wherein
// Recent Topics won't have applied focus to its table yet.
// Recent Conversations and then navigate to the next topic, wherein
// Recent Conversations won't have applied focus to its table yet.
//
// Recent Topics's own navigation just lets `Enter` be
// Recent Conversations' own navigation just lets `Enter` be
// treated as a click on the highlighted message, so we
// don't need to do anything there. But if nothing is
// focused (say, during the race or after clicking on the

View File

@ -49,7 +49,7 @@ function maybe_add_narrowed_messages(messages, msg_list, callback, attempt = 1)
timeout: 5000,
success(data) {
if (!narrow_state.is_message_feed_visible() || msg_list !== message_lists.current) {
// We unnarrowed or moved to Recent Topics in the meantime.
// We unnarrowed or moved to Recent Conversations in the meantime.
return;
}
@ -331,7 +331,7 @@ export function update_messages(events) {
}
moved_message.last_edit_timestamp = event.edit_timestamp;
// Remove the recent topics entry for the old topics;
// Remove the Recent Conversations entry for the old topics;
// must be called before we call set_message_topic.
//
// TODO: Use a single bulk request to do this removal.
@ -363,7 +363,7 @@ export function update_messages(events) {
moved_message.display_recipient = new_stream_name;
}
// Add the recent topics entry for the new stream/topics.
// Add the Recent Conversations entry for the new stream/topics.
stream_topic_history.add_message({
stream_id: moved_message.stream_id,
topic_name: moved_message.topic,

View File

@ -43,7 +43,7 @@ export function update_top_of_narrow_notices(msg_list) {
) {
const filter = narrow_state.filter();
if (filter === undefined && !narrow_state.is_message_feed_visible()) {
// user moved away from the narrow / filter to recent topics.
// user moved away from the narrow / filter to Recent Conversations.
return;
}
// Potentially display the notice that lets users know

View File

@ -476,7 +476,7 @@ export function initialize(home_view_loaded) {
if (data.found_newest) {
if (page_params.is_spectator) {
// Since for spectators, this is the main fetch, we
// hide the Recent Topics loading indicator here.
// hide the Recent Conversations loading indicator here.
recent_topics_ui.hide_loading_indicator();
}
@ -537,11 +537,11 @@ export function initialize(home_view_loaded) {
// more performant (i.e. avoids this unnecessary extra fetch the
// results of which are basically discarded) and better represents
// more than a few hundred messages' history, but this strategy
// allows "Recent topics" to always show current data (with gaps)
// allows "Recent Conversations" to always show current data (with gaps)
// on page load; the data will be complete once the algorithm
// above catches up to present.
//
// (Users will see a weird artifact where Recent topics has a gap
// (Users will see a weird artifact where Recent Conversations has a gap
// between E.g. 6 days ago and 37 days ago while the catchup
// process runs, so this strategy still results in problematic
// visual artifacts shortly after page load; just more forgivable
@ -553,8 +553,8 @@ export function initialize(home_view_loaded) {
filter: new Filter([{operator: "in", operand: "home"}]),
excludes_muted_topics: true,
});
// TODO: Ideally we'd have loading indicators for recent topics at
// both top and bottom be managed by load_messages, but that
// TODO: Ideally we'd have loading indicators for Recent Conversations
// at both top and bottom be managed by load_messages, but that
// likely depends on other reorganizations of the early loading
// sequence.
recent_topics_ui.show_loading_indicator();

View File

@ -55,7 +55,7 @@ export function rerender_for_muted_user() {
activity.redraw();
pm_list.update_private_messages();
// If a user is (un)muted, we want to update their avatars on the recent topics
// If a user is (un)muted, we want to update their avatars on the Recent Conversations
// participants column.
recent_topics_ui.complete_rerender();
}

View File

@ -197,7 +197,7 @@ export function activate(raw_operators, opts) {
// The empty narrow is the home view; so deactivate any narrow if
// no operators were specified. Take us to all messages when this
// happens from recent conversations view.
// happens from Recent Conversations view.
if (raw_operators.length === 0) {
deactivate(coming_from_recent_topics);
return;
@ -382,7 +382,7 @@ export function activate(raw_operators, opts) {
if (coming_from_recent_topics) {
recent_topics_ui.hide();
} else {
// If recent topics was not visible, then we are switching
// If Recent Conversations was not visible, then we are switching
// from another message list view. Save the scroll position in
// that message list, so that we can restore it if/when we
// later navigate back to that view.
@ -1023,7 +1023,7 @@ export function deactivate(coming_from_recent_topics = false, is_actively_scroll
message_lists.home in it.
*/
search.clear_search_form();
// Both All messages and Recent topics have `undefined` filter.
// Both All messages and Recent Conversations have `undefined` filter.
// Return if already in the All message narrow.
if (narrow_state.filter() === undefined && !coming_from_recent_topics) {
return;

View File

@ -22,7 +22,7 @@ export function active() {
export function filter() {
// Both, `All messages` and
// `Recent topics` have `current_filter=undefined`
// `Recent Conversations` have `current_filter=undefined`
return current_filter;
}

View File

@ -64,7 +64,7 @@ const MAX_EXTRA_SENDERS = 10;
// `row_focus` and `col_focus`.
export let $current_focus_elem = "table";
// If user clicks a topic in recent topics, then
// If user clicks a topic in Recent Conversations, then
// we store that topic here so that we can restore focus
// to that topic when user revisits.
let last_visited_topic = "";
@ -105,7 +105,7 @@ export function save_filters() {
}
export function is_in_focus() {
// Check if user is focused on recent topics.
// Check if user is focused on Recent Conversations.
return (
is_visible() &&
!compose_state.composing() &&
@ -245,7 +245,7 @@ export function revive_current_focus() {
// link and focus to the element prior to the rerender.
// We try to avoid setting focus when user
// is not focused on recent topics.
// is not focused on Recent Conversations.
if (!is_in_focus()) {
return false;
}
@ -258,7 +258,7 @@ export function revive_current_focus() {
if (is_table_focused()) {
if (last_visited_topic) {
// If the only message in the topic was deleted,
// then the topic will not be in recent topics data.
// then the topic will not be in Recent Conversations data.
if (topics.get(last_visited_topic) !== undefined) {
const topic_last_msg_id = topics.get(last_visited_topic).last_msg_id;
const current_list = topics_widget.get_current_list();
@ -563,7 +563,7 @@ export function filters_should_hide_topic(topic_data) {
}
if (!filters.has("include_muted") && topic_data.type === "stream") {
// We want to show the unmuted topics within muted streams in the recent topics.
// We want to show the unmuted topics within muted streams in Recent Conversations.
const topic_unmuted = Boolean(user_topics.is_topic_unmuted(msg.stream_id, msg.topic));
const topic_muted = Boolean(user_topics.is_topic_muted(msg.stream_id, msg.topic));
const stream_muted = stream_data.is_muted(msg.stream_id);
@ -903,7 +903,7 @@ export function show() {
if (is_visible()) {
// If we're already visible, E.g. because the user hit Esc
// while already in the recent topics view, do nothing.
// while already in the Recent Conversations view, do nothing.
return;
}
// Hide selected elements in the left sidebar.
@ -911,7 +911,7 @@ export function show() {
stream_list.handle_narrow_deactivated();
// Hide "middle-column" which has html for rendering
// a messages narrow. We hide it and show recent topics.
// a messages narrow. We hide it and show Recent Conversations.
$("#message_feed_container").hide();
$("#recent_topics_view").show();
set_visible(true);
@ -953,7 +953,7 @@ export function hide() {
// This solves a bug with message_view_header
// being broken sometimes when we narrow
// to a filter and back to recent topics
// to a filter and back to Recent Conversations
// before it completely re-rerenders.
message_view_header.render_title_area();

View File

@ -810,7 +810,7 @@ export function stream_has_any_unmuted_mentions(stream_id) {
export function topic_has_any_unread_mentions(stream_id, topic) {
// Because this function is called in a loop for every displayed
// Recent Topics row, it's important for it to run in O(1) time.
// Recent Conversations row, it's important for it to run in O(1) time.
const topic_key = stream_id + ":" + topic.toLowerCase();
return unread_mention_topics.get(topic_key) && unread_mention_topics.get(topic_key).size > 0;
}

View File

@ -23,7 +23,7 @@ function set_widget_in_message($row, $widget_elem) {
const $content_holder = $row.find(".message_content");
// Avoid adding the $widget_elem if it already exists.
// This can happen when the app loads in the "Recent topics"
// This can happen when the app loads in the "Recent Conversations"
// view and the user changes the view to "All messages".
// This is important since jQuery removes all the event handlers
// on `empty()`ing an element.

View File

@ -448,7 +448,7 @@
}
.user_circle {
/* Shrink the user activity circle for the recent topics context. */
/* Shrink the user activity circle for the Recent Conversations context. */
min-width: 7px;
height: 7px;
float: left;

View File

@ -120,7 +120,7 @@ body {
*/
--browser-overlay-scrollbar-width: 10px;
/* This is a rough estimate for height occupied by recent topics filters.
/* This is a rough estimate for height occupied by Recent Conversations filters.
We expect `resize.js` to update this once UI is initialized. */
--recent-topics-filters-height: 50px;

View File

@ -92,7 +92,7 @@ run_test("unread_ops", ({override}) => {
},
];
// We don't want recent topics to process message for this test.
// We don't want Recent Conversations to process message for this test.
recent_topics_util.set_visible(false);
// Make our test message appear to be unread, so that

View File

@ -334,7 +334,7 @@ test("process_pms", () => {
id: 3,
});
// Recent topics displays avatars in the opposite order to this since
// Recent Conversations displays avatars in the opposite order to this since
// that was simpler to implement in HTML.
assert.deepEqual(rs.get_pm_recent_senders(user_ids_string), {
participants: [1, 3, 2],

View File

@ -717,7 +717,7 @@ test("main_file_drop_compose_mode", ({override_rewire}) => {
assert.equal(compose_actions_start_called, false);
assert.equal(compose_actions_respond_to_message_called, true);
// Test drop on recent topics view
// Test drop on Recent Conversations view
compose_actions_respond_to_message_called = false;
override_rewire(message_lists, "current", {
selected_message() {