Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

left_sidebar: Show all topics when viewing topic in collapsed folder.

Amit Patilfd47c0288c89
diff --git a/web/src/sidebar_ui.ts b/web/src/sidebar_ui.ts
index 18058c2c826..765f5f7239b 100644
--- a/web/src/sidebar_ui.ts
+++ b/web/src/sidebar_ui.ts
@@ -574,9 +574,6 @@ function all_rows(): JQuery {
const $collapsed_channels = $(
".stream-list-section-container.collapsed .narrow-filter:not(.stream-expanded) .bottom_left_row",
);
- const $hidden_topic_rows = $(
- ".stream-list-section-container.collapsed .topic-list-item:not(.active-sub-filter).bottom_left_row",
- );
// Exclude toggle inactive / muted channels row from the list of rows if user is searching.
const $toggle_inactive_or_muted_channels_row = $(
@@ -593,7 +590,6 @@ function all_rows(): JQuery {
.not($inactive_or_muted_rows)
.not($collapsed_views)
.not($collapsed_channels)
- .not($hidden_topic_rows)
.not($toggle_inactive_or_muted_channels_row)
.not($hidden_topic_search_hint_row);
diff --git a/web/src/stream_list.ts b/web/src/stream_list.ts
index 066d7adbe21..b602df709c8 100644
--- a/web/src/stream_list.ts
+++ b/web/src/stream_list.ts
@@ -589,16 +589,14 @@ export function rewire_update_stream_section_mention_indicators(
}
/* When viewing a channel in a collapsed folder, we show that active
- highlighted channel in the left sidebar even though the folder is
- collapsed. If there's an active highlighted topic within the
- channel, we show it too. If there's no highlighted topic within the
- channel, then we should treat this like an empty topic list and remove
- the left bracket. */
+ highlighted channel in left sidebar even though the folder is collapsed.
+ If it has topics, keep the bracket visible. If the topic list is empty,
+ hide the bracket. */
export let maybe_hide_topic_bracket = function (section_id: string): void {
const $container = $(`#stream-list-${section_id}-container`);
const is_collapsed = collapsed_sections.has(section_id);
- const $highlighted_topic = $container.find(".topic-list-item.active-sub-filter");
- $container.toggleClass("hide-topic-bracket", is_collapsed && $highlighted_topic.length === 0);
+ const $topic_items = $container.find(".topic-list-item");
+ $container.toggleClass("hide-topic-bracket", is_collapsed && $topic_items.length === 0);
};
export function rewire_maybe_hide_topic_bracket(value: typeof maybe_hide_topic_bracket): void {
diff --git a/web/styles/left_sidebar.css b/web/styles/left_sidebar.css
index c8761755801..20b75e03e0c 100644
--- a/web/styles/left_sidebar.css
+++ b/web/styles/left_sidebar.css
@@ -706,7 +706,6 @@
#streams_list .stream-list-section-container.collapsed {
.narrow-filter:not(.stream-expanded),
.stream-list-toggle-inactive-or-muted-channels,
- .topic-list-item:not(.active-sub-filter),
&.hide-topic-bracket ul.topic-list.topic-list-has-topics::before,
&.hide-topic-bracket ul.topic-list.topic-list-has-topics::after {
display: none;