fix(sidebar): "See fewer channels" sits below the revealed channels
- the toggle closed the team list before the hidden channels; now it is the last row - cargo fmt on new_chat.rs imports Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@@ -10,8 +10,8 @@ use gpui_kit::component::{
10
10
use gpui_kit::prelude::FluentBuilder as _;
11
11
use gpui_kit::*;
12
12
use store::ChatRecord;
13
use teams_core::substrate_search::{SearchPerson, SearchSession};
14
13
use teams_core::MentionCandidate;
14
use teams_core::substrate_search::{SearchPerson, SearchSession};
15
15
16
16
use super::avatar::person_avatar;
17
17
use super::switcher::clamp_highlight;
@@ -912,10 +912,10 @@ mod tests {
912
912
use store::{ChatRecord, MemberRecord};
913
913
914
914
use super::{
915
composer_placeholder, enter_action, merge_remote, pick_detail, search_results,
916
suggested_people, EnterAction, Pick,
915
EnterAction, Pick, composer_placeholder, enter_action, merge_remote, pick_detail,
916
search_results, suggested_people,
917
917
};
918
use crate::data::{existing_one_on_one, Person};
918
use crate::data::{Person, existing_one_on_one};
919
919
920
920
fn me() -> Person {
921
921
Person {
@@ -10,8 +10,8 @@ use gpui_kit::component::{10
use gpui_kit::prelude::FluentBuilder as _;10
use gpui_kit::prelude::FluentBuilder as _;11
use gpui_kit::*;11
use gpui_kit::*;12
use store::ChatRecord;12
use store::ChatRecord;13
use teams_core::substrate_search::{SearchPerson, SearchSession};14
use teams_core::MentionCandidate;13
use teams_core::MentionCandidate;14
use teams_core::substrate_search::{SearchPerson, SearchSession};15
15
16
use super::avatar::person_avatar;16
use super::avatar::person_avatar;17
use super::switcher::clamp_highlight;17
use super::switcher::clamp_highlight;@@ -912,10 +912,10 @@ mod tests {912
use store::{ChatRecord, MemberRecord};912
use store::{ChatRecord, MemberRecord};913
913
914
use super::{914
use super::{915
composer_placeholder, enter_action, merge_remote, pick_detail, search_results,915
EnterAction, Pick, composer_placeholder, enter_action, merge_remote, pick_detail,916
suggested_people, EnterAction, Pick,916
search_results, suggested_people,917
};917
};918
use crate::data::{existing_one_on_one, Person};918
use crate::data::{Person, existing_one_on_one};919
919
920
fn me() -> Person {920
fn me() -> Person {921
Person {921
Person {@@ -1562,6 +1562,15 @@ impl SidebarView {
1562
1562
if rows.hidden_count == 0 {
1563
1563
return list;
1564
1564
}
1565
for channel in rows.revealed {
1566
list = list.child(self.team_channel_row(
1567
channel,
1568
false,
1569
channel_name_style(channel_shows_unread(entry, channel), false, false),
1570
entry.channel_notifications(&channel.id),
1571
channel_badge(entry, &channel.id),
1572
));
1573
}
1565
1574
let toggle_id = team_id.clone();
1566
1575
list = list.child(self.see_all_channels_row(
1567
1576
SharedString::from(format!("hidden-channels-{team_id}")),
@@ -1573,15 +1582,6 @@ impl SidebarView {
1573
1582
cx.notify();
1574
1583
}),
1575
1584
));
1576
for channel in rows.revealed {
1577
list = list.child(self.team_channel_row(
1578
channel,
1579
false,
1580
channel_name_style(channel_shows_unread(entry, channel), false, false),
1581
entry.channel_notifications(&channel.id),
1582
channel_badge(entry, &channel.id),
1583
));
1584
}
1585
1585
list
1586
1586
}
1587
1587
@@ -1562,6 +1562,15 @@ impl SidebarView {1562
if rows.hidden_count == 0 {1562
if rows.hidden_count == 0 {1563
return list;1563
return list;1564
}1564
}1565
for channel in rows.revealed {1566
list = list.child(self.team_channel_row(1567
channel,1568
false,1569
channel_name_style(channel_shows_unread(entry, channel), false, false),1570
entry.channel_notifications(&channel.id),1571
channel_badge(entry, &channel.id),1572
));1573
}1565
let toggle_id = team_id.clone();1574
let toggle_id = team_id.clone();1566
list = list.child(self.see_all_channels_row(1575
list = list.child(self.see_all_channels_row(1567
SharedString::from(format!("hidden-channels-{team_id}")),1576
SharedString::from(format!("hidden-channels-{team_id}")),@@ -1573,15 +1582,6 @@ impl SidebarView {1573
cx.notify();1582
cx.notify();1574
}),1583
}),1575
));1584
));1576
for channel in rows.revealed {1577
list = list.child(self.team_channel_row(1578
channel,1579
false,1580
channel_name_style(channel_shows_unread(entry, channel), false, false),1581
entry.channel_notifications(&channel.id),1582
channel_badge(entry, &channel.id),1583
));1584
}1585
list1585
list1586
}1586
}1587
1587