mirror of
https://github.com/zulip/zulip.git
synced 2025-11-19 14:08:23 +00:00
Revert "recent_view_ui: Avoid non-contiguous rows in recent view."
This reverts commit 2348d6f1f9.
This commit is contained in:
@@ -61,11 +61,9 @@ function process_result(data, opts) {
|
||||
}
|
||||
}
|
||||
|
||||
if (messages.length > 0 && (opts.msg_list === message_lists.home || opts.is_recent_view_data)) {
|
||||
recent_view_ui.process_messages(messages);
|
||||
|
||||
// Update the recent view UI's understanding of which messages
|
||||
// we have available for the recent view.
|
||||
if (messages.length > 0 && opts.msg_list === message_lists.home) {
|
||||
// We keep track of how far back we've fetched messages for, for messaging in
|
||||
// the recent view. This assumes `data.messages` is already sorted.
|
||||
const oldest_timestamp = all_messages_data.first().timestamp;
|
||||
recent_view_ui.set_oldest_message_date(
|
||||
oldest_timestamp,
|
||||
@@ -75,6 +73,7 @@ function process_result(data, opts) {
|
||||
}
|
||||
|
||||
huddle_data.process_loaded_messages(messages);
|
||||
recent_view_ui.process_messages(messages);
|
||||
stream_list.update_streams_sidebar();
|
||||
stream_list.maybe_scroll_narrow_into_view();
|
||||
|
||||
@@ -592,7 +591,6 @@ export function initialize(home_view_loaded) {
|
||||
num_before: consts.recent_view_initial_fetch_size,
|
||||
num_after: 0,
|
||||
msg_list_data: recent_view_message_list_data,
|
||||
is_recent_view_data: true,
|
||||
cont: recent_view_ui.hide_loading_indicator,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -370,15 +370,10 @@ export function hide_loading_indicator() {
|
||||
}
|
||||
|
||||
export function process_messages(messages) {
|
||||
// This code path processes messages from 3 sources:
|
||||
|
||||
// 1. Newly sent messages from the server_events system. This is safe to
|
||||
// process because we always will have the latest previously sent messages.
|
||||
// 2. Messages in all_messages_data, the main cache of contiguous
|
||||
// message history that the client maintains.
|
||||
// 3. Latest messages fetched specifically for Recent view when
|
||||
// the browser first loads. We will be able to remove this once
|
||||
// all_messages_data is fetched in a better order.
|
||||
// While this is inexpensive and handles all the cases itself,
|
||||
// the UX can be bad if user wants to scroll down the list as
|
||||
// the UI will be returned to the beginning of the list on every
|
||||
// update.
|
||||
let conversation_data_updated = false;
|
||||
if (messages.length > 0) {
|
||||
for (const msg of messages) {
|
||||
|
||||
Reference in New Issue
Block a user