message_list: Don't always cache "Combined feed" view.

Important changes in this commit:
* We only cache message list for "Combined feed" if it is the
  default view.

* We modify existing handling of home message list code so that
  it can be used to for any message list that we want to cache
  using a new `preserve_rendered_state` variable.

* narrow_state.filter() returns the filter of combined feed view  list
  instead of `undefined`.

* We start fetching messages from the latest message on app load.

* Messages in all messages data and Recent view are always synced.

* If combined feed view list is not cached, we don't track it's
  last pointer, effectively sending user to the latest unread
  message always .
This commit is contained in:
Aman Agrawal
2024-04-21 03:31:35 +00:00
committed by Tim Abbott
parent 2ccbb9bc00
commit 103c37f23a
31 changed files with 183 additions and 850 deletions

View File

@@ -1241,7 +1241,7 @@ export function delete_topic(stream_id, topic_name, failures = 0) {
});
}
export function handle_narrow_deactivated() {
export function restore_edit_state_after_message_view_change() {
assert(message_lists.current !== undefined);
for (const [idx, elem] of currently_editing_messages) {
if (message_lists.current.get(idx) !== undefined) {