left_sidebar: Add unread markers to channel section headers.

This commit is contained in:
Evy Kassirer
2025-06-24 11:43:35 -07:00
committed by Tim Abbott
parent 739debf7b4
commit bc6b0cccf4
6 changed files with 75 additions and 3 deletions

View File

@@ -17,6 +17,7 @@ import * as compose_actions from "./compose_actions.ts";
import type {Filter} from "./filter.ts";
import * as hash_util from "./hash_util.ts";
import * as keydown_util from "./keydown_util.ts";
import * as left_sidebar_navigation_area from "./left_sidebar_navigation_area.ts";
import {ListCursor} from "./list_cursor.ts";
import * as narrow_state from "./narrow_state.ts";
import * as pm_list from "./pm_list.ts";
@@ -321,6 +322,8 @@ export function build_stream_list(force_rerender: boolean): void {
add_sidebar_li(stream_id, $(`#stream-list-${section.id}`));
}
}
// Rerendering can moving channels between folders and change heading unread counts.
left_sidebar_navigation_area.update_dom_with_unread_counts(unread.get_counts(), false);
sidebar_ui.update_unread_counts_visibility();
collapse_collapsed_sections();
}
@@ -1124,7 +1127,10 @@ export function set_event_handlers({
"click",
".stream-list-section-container .add-stream-icon-container",
(e) => {
// To prevent toggling the header
// The browser default behavior of following the href on
// this link is correct. But we need to avoid triggering
// the click handler for the containing row, though (which
// would toggle the section).
e.stopPropagation();
},
);