BlueGit

ict rusty-teams

feat(search): search dropdown opens on the search box like Teams

- card sits at the title bar search box, no dimmed backdrop
- search icon in the field, matches in bold text instead of accent color

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

metis Daniel Däschle · pushed by metis

Authored 2026-11-09 · 3 weeks ago

Hash
605aaec796fb03ca7e74a2b2fb1f61f8801e0748
Parent
de446ecf
1 file changed +15 −6
crates/app/src/views/switcher.rs +15 −6
@@ -38,6 +38,7 @@ const SERVER_DEBOUNCE: Duration = Duration::from_millis(200);
38 38 const MESSAGE_GROUP: &str = "Messages";
39 39 const PEOPLE_GROUP: &str = "People";
40 40 const CARD_WIDTH: f32 = 520.;
41 const CARD_TOP: f32 = 6.;
41 42
42 43 pub enum SwitcherEvent {
43 44 Pick(Selection),
@@ -563,8 +564,8 @@ impl Render for Switcher {
563 564 (
564 565 range.clone(),
565 566 HighlightStyle {
566 color: Some(theme::accent_text()),
567 font_weight: Some(FontWeight::SEMIBOLD),
567 color: Some(theme::text()),
568 font_weight: Some(FontWeight::BOLD),
568 569 ..Default::default()
569 570 },
570 571 )
@@ -653,11 +654,10 @@ impl Render for Switcher {
653 654 .size_full()
654 655 .top_0()
655 656 .left_0()
656 .bg(theme::background().opacity(0.6))
657 657 .flex()
658 658 .justify_center()
659 659 .items_start()
660 .pt(px(72.))
660 .pt(px(CARD_TOP))
661 661 .on_click(cx.listener(|_, _, _, cx| cx.emit(SwitcherEvent::Close)))
662 662 .child(
663 663 v_flex()
@@ -670,9 +670,18 @@ impl Render for Switcher {
670 670 .on_click(|_, _, cx| cx.stop_propagation())
671 671 .on_key_down(cx.listener(Self::on_key_down))
672 672 .child(
673 div()
673 h_flex()
674 674 .p(px(8.))
675 .child(Input::new(&self.input).appearance(false).bordered(false)),
675 .pl(px(12.))
676 .gap(px(8.))
677 .items_center()
678 .child(icon(IconName::Search, 14., theme::text_muted()))
679 .child(
680 div()
681 .flex_1()
682 .min_w_0()
683 .child(Input::new(&self.input).appearance(false).bordered(false)),
684 ),
676 685 )
677 686 .child(
678 687 v_flex()
@@ -38,6 +38,7 @@ const SERVER_DEBOUNCE: Duration = Duration::from_millis(200);
38const MESSAGE_GROUP: &str = "Messages";
38const MESSAGE_GROUP: &str = "Messages";
39const PEOPLE_GROUP: &str = "People";
39const PEOPLE_GROUP: &str = "People";
40const CARD_WIDTH: f32 = 520.;
40const CARD_WIDTH: f32 = 520.;
41const CARD_TOP: f32 = 6.;
41
42
42pub enum SwitcherEvent {
43pub enum SwitcherEvent {
43 Pick(Selection),
44 Pick(Selection),
@@ -563,8 +564,8 @@ impl Render for Switcher {
563 (
564 (
564 range.clone(),
565 range.clone(),
565 HighlightStyle {
566 HighlightStyle {
566 color: Some(theme::accent_text()),
567 color: Some(theme::text()),
567 font_weight: Some(FontWeight::SEMIBOLD),
568 font_weight: Some(FontWeight::BOLD),
568 ..Default::default()
569 ..Default::default()
569 },
570 },
570 )
571 )
@@ -653,11 +654,10 @@ impl Render for Switcher {
653 .size_full()
654 .size_full()
654 .top_0()
655 .top_0()
655 .left_0()
656 .left_0()
656 .bg(theme::background().opacity(0.6))
657 .flex()
657 .flex()
658 .justify_center()
658 .justify_center()
659 .items_start()
659 .items_start()
660 .pt(px(72.))
660 .pt(px(CARD_TOP))
661 .on_click(cx.listener(|_, _, _, cx| cx.emit(SwitcherEvent::Close)))
661 .on_click(cx.listener(|_, _, _, cx| cx.emit(SwitcherEvent::Close)))
662 .child(
662 .child(
663 v_flex()
663 v_flex()
@@ -670,9 +670,18 @@ impl Render for Switcher {
670 .on_click(|_, _, cx| cx.stop_propagation())
670 .on_click(|_, _, cx| cx.stop_propagation())
671 .on_key_down(cx.listener(Self::on_key_down))
671 .on_key_down(cx.listener(Self::on_key_down))
672 .child(
672 .child(
673 div()
673 h_flex()
674 .p(px(8.))
674 .p(px(8.))
675 .child(Input::new(&self.input).appearance(false).bordered(false)),
675 .pl(px(12.))
676 .gap(px(8.))
677 .items_center()
678 .child(icon(IconName::Search, 14., theme::text_muted()))
679 .child(
680 div()
681 .flex_1()
682 .min_w_0()
683 .child(Input::new(&self.input).appearance(false).bordered(false)),
684 ),
676 )
685 )
677 .child(
686 .child(
678 v_flex()
687 v_flex()