left_sidebar: Uncollapse folder when clicking an active channel in it.

This commit is contained in:
Evy Kassirer
2025-07-21 19:55:47 -07:00
committed by Tim Abbott
parent 18463b45a2
commit 80c9489683

View File

@@ -981,6 +981,16 @@ function on_sidebar_channel_click(
e.stopPropagation();
}
const section_for_stream = stream_list_sort.current_section_id_for_stream(stream_id);
if (collapsed_sections.has(section_for_stream)) {
// In the event that user clicks on the channel in the left
// sidebar when its folder is collapsed, which is only there
// to click on if the user was already viewing that channel,
// we uncollapse the section to make the filtering component
// visible.
toggle_section_collapse($(`#stream-list-${section_for_stream}-container`));
}
const current_narrow_stream_id = narrow_state.stream_id();
const current_topic = narrow_state.topic();
@@ -1261,8 +1271,9 @@ export let scroll_stream_into_view = function ($stream_li: JQuery): void {
$container,
stream_filter_height + header_height,
);
// Note: If the stream is in a collapsed folder, we don't uncollapse the
// folder.
// Note: If the stream is in a collapsed folder, we don't uncollapse
// the folder. We do uncollapse when the user clicks on the channel,
// but that's handled elsewhere.
};
export function rewire_scroll_stream_into_view(value: typeof scroll_stream_into_view): void {