unread: Stop treating bottom of render windows as the global bottom.

The previous logic for both scrolling down and using pagedown would
incorrectly mark an entire conversation as read when reaching the
bottom of a render window, even if there were more messages loaded or
to fetch from the server.

Fix this error in the calculation by asking the correct data
structures if we're actually at the bottom.

To avoid the navigate.js keyboard shortcut code paths circumventing
this new logic, or needing to duplicate it, they now call
process_visible, rather than its helper.
This commit is contained in:
Tim Abbott
2024-01-31 13:22:34 -08:00
parent da7cb0af1c
commit 6562ea94e4
4 changed files with 26 additions and 6 deletions

View File

@@ -1439,6 +1439,18 @@ export class MessageListView {
this.message_containers.clear();
}
is_end_rendered() {
// Used as a helper in checks for whether a given scroll
// position is actually the very end of this view. It could
// fail to be for two reasons: Either some newer messages are
// not rendered due to a render window, or we haven't finished
// fetching the newest messages for this view from the server.
return (
this._render_win_end === this.list.num_items() &&
this.list.data.fetch_status.has_found_newest()
);
}
get_row(id) {
const $row = this._rows.get(id);