From 1b3b5a4256edbc55ec6f15ff36fcf6e055d6223d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Sat, 28 Nov 2026 03:05:07 +0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20ping=20line=20opens=20conne?= =?UTF-8?q?ction=20stats=20too;=20the=20call=20bar=20sheet=20shows=20only?= =?UTF-8?q?=20connection=20and=20traffic,=20full=20detail=20stays=20in=20t?= =?UTF-8?q?he=20header=20stats?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/client/src/gui/builder/overview.rs | 1 + crates/client/src/gui/builder/users.rs | 1 + crates/client/src/gui/call_bar.rs | 7 +++++++ crates/client/src/gui/chat.rs | 4 ++++ crates/client/src/gui/voice_stats.rs | 23 ++++++++++++++++++++++- 5 files changed, 35 insertions(+), 1 deletion(-) diff --git a/crates/client/src/gui/builder/overview.rs b/crates/client/src/gui/builder/overview.rs index b36dcf4..2a2b177 100644 --- a/crates/client/src/gui/builder/overview.rs +++ b/crates/client/src/gui/builder/overview.rs @@ -218,6 +218,7 @@ impl Yumush { .child(div().p(px(space::LG)).child(voice_stats::stats_panel( stats, &|id| self.chat.name_of(id), + voice_stats::Detail::Full, palette, ))), ); diff --git a/crates/client/src/gui/builder/users.rs b/crates/client/src/gui/builder/users.rs index 0e6109e..be23517 100644 --- a/crates/client/src/gui/builder/users.rs +++ b/crates/client/src/gui/builder/users.rs @@ -1058,6 +1058,7 @@ impl Yumush { super::super::voice_stats::stats_panel( stats, &|id| self.chat.name_of(id), + super::super::voice_stats::Detail::Full, palette, ) .pt(px(space::MD)) diff --git a/crates/client/src/gui/call_bar.rs b/crates/client/src/gui/call_bar.rs index 7e22dae..49d452a 100644 --- a/crates/client/src/gui/call_bar.rs +++ b/crates/client/src/gui/call_bar.rs @@ -180,9 +180,16 @@ pub fn view(bar: CallBar, actions: CallActions, t: Tokens) -> Div { ) .child( div() + .id("bar_ping_line") .flex_none() .w(px(size::ROW)) .h(px(size::ICON)) + .cursor_pointer() + .tip("Connection stats") + .on_click({ + let stats = run(&actions.stats); + move |_, window, cx| stats(window, cx) + }) .child(super::parts::spark( pings, super::voice_stats::SAMPLE_HISTORY, diff --git a/crates/client/src/gui/chat.rs b/crates/client/src/gui/chat.rs index 3f1eab5..64c008a 100644 --- a/crates/client/src/gui/chat.rs +++ b/crates/client/src/gui/chat.rs @@ -1450,6 +1450,10 @@ impl Yumush { .child(voice_stats::stats_panel( &self.chat.stats, &|id| self.chat.name_of(id), + match at { + StatsAt::Header => voice_stats::Detail::Full, + StatsAt::Dock => voice_stats::Detail::Connection, + }, palette, )), ) diff --git a/crates/client/src/gui/voice_stats.rs b/crates/client/src/gui/voice_stats.rs index 4590dd3..98a9571 100644 --- a/crates/client/src/gui/voice_stats.rs +++ b/crates/client/src/gui/voice_stats.rs @@ -79,9 +79,30 @@ pub fn quality(samples: &VecDeque) -> Option { samples.back().map(Quality::of) } -pub fn stats_panel(stats: &Stats, name: &dyn Fn(Id) -> String, palette: Palette) -> Div { +#[derive(Clone, Copy, PartialEq, Eq)] +pub enum Detail { + Connection, + Full, +} + +pub fn stats_panel( + stats: &Stats, + name: &dyn Fn(Id) -> String, + detail: Detail, + palette: Palette, +) -> Div { let t = palette.tokens; let share = &stats.share; + if detail == Detail::Connection { + return stack(space::XL) + .w(px(COLUMN_W)) + .when(!stats.voice.is_empty(), |column| { + column.child(connection(stats, t)) + }) + .when(!stats.traffic.is_empty(), |column| { + column.child(traffic(stats, t)) + }); + } band(space::XXL) .items_start() .flex_wrap()