From cf9648db726db3ef67e1fc2c05b23eba2ad71a3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Fri, 27 Nov 2026 18:42:24 +0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20call=20bar=20=E2=80=94=20yo?= =?UTF-8?q?ur=20line=20at=20the=20bottom=20of=20the=20main=20panel=20(name?= =?UTF-8?q?,=20voice=20line,=20ping=E2=86=92stats,=20mute/deafen/camera/sh?= =?UTF-8?q?are=20split=20buttons,=20leave)=20replaces=20the=20sidebar=20do?= =?UTF-8?q?ck;=20call=5Fbar::view=20shared=20by=20app=20and=20YUMUSH=5FGAL?= =?UTF-8?q?LERY=3Dcall;=20artifact=20twin=20in=20design/gallery.html#call?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/client/design/gallery.html | 12 +- crates/client/design/parts.js | 2 +- crates/client/src/gui.rs | 1 + crates/client/src/gui/call_bar.rs | 103 +++++++ crates/client/src/gui/chat.rs | 1 + crates/client/src/gui/dock.rs | 421 +++++----------------------- crates/client/src/gui/gallery.rs | 48 +++- crates/client/src/gui/parts.rs | 33 +-- crates/client/src/gui/share_view.rs | 18 +- crates/client/src/gui/sidebar.rs | 1 - crates/client/src/gui/style.rs | 3 +- crates/client/src/gui/wave.rs | 9 - harness/compare.sh | 2 +- 13 files changed, 248 insertions(+), 406 deletions(-) create mode 100644 crates/client/src/gui/call_bar.rs diff --git a/crates/client/design/gallery.html b/crates/client/design/gallery.html index 0a6909e..22d0e18 100644 --- a/crates/client/design/gallery.html +++ b/crates/client/design/gallery.html @@ -22,7 +22,8 @@ body{padding:var(--space-xxl);overflow:hidden} diff --git a/crates/client/design/parts.js b/crates/client/design/parts.js index 2ed05b5..9a1153c 100644 --- a/crates/client/design/parts.js +++ b/crates/client/design/parts.js @@ -1,5 +1,5 @@ window.Yumush=(()=>{ -const ICON={mic:'',camera:'',off:'',up:''}; +const ICON={mic:'',camera:'',off:'',up:'',micoff:'',head:'',video:'',screen:''}; const bands=seed=>Array.from({length:24},(_,i)=>(Math.sin(i*.7+seed)*.5+.5)*.8); const w=(text,cls='')=>`
${text}
`; const icon=(k,cls='')=>`
${ICON[k]}
`; diff --git a/crates/client/src/gui.rs b/crates/client/src/gui.rs index de3113a..c3af014 100644 --- a/crates/client/src/gui.rs +++ b/crates/client/src/gui.rs @@ -42,6 +42,7 @@ use crate::{ }; mod auth; +mod call_bar; pub mod gallery; mod parts; pub mod style; diff --git a/crates/client/src/gui/call_bar.rs b/crates/client/src/gui/call_bar.rs new file mode 100644 index 0000000..d35e41b --- /dev/null +++ b/crates/client/src/gui/call_bar.rs @@ -0,0 +1,103 @@ +use std::{collections::VecDeque, rc::Rc}; + +use gpui_kit::{ + AnyElement, App, Div, FontWeight, InteractiveElement, ParentElement, + SharedString, StatefulInteractiveElement, Styled, Window, assets::IconName, div, px, +}; + +use super::{ + Tooltip as _, + parts::{Ink, Text, Tone, Voice, band, icon_button, thread, voice_line, words}, + style::{Tokens, size, space}, +}; + +pub type Action = Rc; + +pub struct CallBar { + pub name: SharedString, + pub bands: Option>, + pub voice: Voice, + pub ping: Option, + pub muted: bool, + pub deafened: bool, + pub camera: bool, + pub screen: bool, +} + +pub struct CallActions { + pub mute: Action, + pub deafen: Action, + pub camera: Action, + pub screen: Action, + pub leave: Action, + pub stats: Action, + pub camera_more: AnyElement, + pub screen_more: AnyElement, +} + +fn run(action: &Action) -> impl Fn(&mut Window, &mut App) + 'static { + let action = action.clone(); + move |window, cx| action(window, cx) +} + +pub fn view(bar: CallBar, actions: CallActions, t: Tokens) -> Div { + let tone = |on: bool| if on { Tone::On } else { Tone::Idle }; + let alarm = |on: bool| if on { Tone::Danger } else { Tone::Idle }; + let ping_ink = if bar.voice == Voice::Frayed { Ink::Bad } else { Ink::Faint }; + let ping = bar.ping.map_or_else(|| "–".to_string(), |ping| format!("{ping:.0} ms")); + let stats = run(&actions.stats); + let controls = band(space::XS) + .flex_none() + .child(icon_button( + format!("bar_mute_{}", bar.muted), + if bar.muted { IconName::MicOff } else { IconName::Mic }, + if bar.muted { "Unmute" } else { "Mute" }, + alarm(bar.muted), + t, + run(&actions.mute), + )) + .child(icon_button( + format!("bar_deafen_{}", bar.deafened), + if bar.deafened { IconName::HeadphoneOff } else { IconName::Headphones }, + if bar.deafened { "Undeafen" } else { "Deafen" }, + alarm(bar.deafened), + t, + run(&actions.deafen), + )) + .child(icon_button( + format!("bar_camera_{}", bar.camera), + IconName::Video, + if bar.camera { "Turn off camera" } else { "Turn on camera" }, + tone(bar.camera), + t, + run(&actions.camera), + )) + .child(actions.camera_more) + .child(icon_button( + format!("bar_screen_{}", bar.screen), + IconName::ScreenShare, + if bar.screen { "Stop sharing" } else { "Share screen" }, + tone(bar.screen), + t, + run(&actions.screen), + )) + .child(actions.screen_more) + .child(icon_button("bar_leave", IconName::PhoneOff, "Leave call", Tone::Danger, t, run(&actions.leave))); + div().flex_none().child(thread(t)).child( + band(space::LG) + .h(px(size::ROW + space::MD)) + .px(px(space::LG)) + .child(words(bar.name, Text::Ui, Ink::Paper, t).font_weight(FontWeight::MEDIUM).flex_none()) + .child(div().flex_1().min_w(px(size::CONTROL)).h(px(size::ICON)).child(voice_line(bar.bands.as_ref(), bar.voice, t))) + .child( + div() + .id("bar_ping") + .tip("Connection stats") + .cursor_pointer() + .flex_none() + .on_click(move |_, window, cx| stats(window, cx)) + .child(words(ping, Text::Label, ping_ink, t)), + ) + .child(controls), + ) +} diff --git a/crates/client/src/gui/chat.rs b/crates/client/src/gui/chat.rs index 752133b..3331387 100644 --- a/crates/client/src/gui/chat.rs +++ b/crates/client/src/gui/chat.rs @@ -1377,6 +1377,7 @@ impl Yumush { None => panel.child(empty_state(palette)), }, }) + .children(self.dock(entity, palette, cx)) } fn stats_side(&self, palette: Palette) -> Option { diff --git a/crates/client/src/gui/dock.rs b/crates/client/src/gui/dock.rs index 6563e20..f1f5288 100644 --- a/crates/client/src/gui/dock.rs +++ b/crates/client/src/gui/dock.rs @@ -1,372 +1,81 @@ -use std::time::Instant; +use std::rc::Rc; -use common::{ - model::{Community, Id}, - share::Kind, -}; -use gpui_kit::{ - App, Div, Entity, FontWeight, Hsla, InteractiveElement, IntoElement, ParentElement, Stateful, - StatefulInteractiveElement, Styled, Window, assets::IconName, component::Icon, div, px, -}; +use common::share::Kind; +use gpui_kit::{App, Entity, IntoElement}; use super::{ - Palette, Tooltip as _, Yumush, chat::VoiceState, clickable, community_name, entity_action, - hoverable_with, share_view::kind_icon, text, voice_stats, wave, widget::icon_button, + Palette, Yumush, + call_bar::{self, CallActions, CallBar}, + chat::VoiceState, + entity_action, + parts::Voice, + style::Tokens, + voice_stats::{self, Quality}, }; -const PING_POINTS: usize = 12; - impl Yumush { - pub(super) fn dock(&self, entity: &Entity, palette: Palette) -> Option { - let community = self.chat.voice_room()?; - let VoiceState::In { since, .. } = &self.chat.voice_state else { - return None; - }; - let (muted, deafened) = self.chat.voice_flags()?; - let me = self.user.as_ref()?.id; - let tone = voice_stats::quality(&self.chat.voice_samples) - .map_or(palette.ok, |quality| quality.color(palette)); - let panel = div() - .bg(tone.opacity(0.08)) - .border_1() - .border_color(tone.opacity(0.2)) - .rounded(px(10.)) - .p(px(8.)) - .flex() - .flex_col() - .gap(px(6.)) - .child(self.dock_header(entity, community, *since, tone, palette)) - .child(self.dock_voice(entity, me, muted, deafened, palette)) - .child(self.dock_devices(entity, me, palette)); - - Some(panel) - } - - fn dock_header( + pub(super) fn dock( &self, entity: &Entity, - community: &Community, - since: Instant, - tone: Hsla, palette: Palette, - ) -> Div { - let direct = community.kind.is_direct(); - let go_id = community.id; - let go = entity_action(entity, move |yumush, window, cx| { - yumush.go_to_community(go_id, direct, window, cx) - }); - - let ping = self - .chat - .voice_samples - .back() - .map_or(0., |sample| sample.ping_ms); - let start = self.chat.voice_samples.len().saturating_sub(PING_POINTS); - let pings: Vec = self - .chat - .voice_samples - .iter() - .skip(start) - .map(|sample| sample.ping_ms) - .collect(); - let peak = pings.iter().copied().fold(1., f32::max); - let bars = div() - .w(px(PING_POINTS as f32 * 3.)) - .h(px(12.)) - .child(wave::line_of( - pings.iter().map(|ping| ping / peak * 0.9).collect(), - PING_POINTS, - tone, - )); - - div() - .flex() - .items_center() - .gap(px(7.)) - .child( - clickable("dock_go", palette, go) - .tip("Go to channel") - .min_w_0() - .truncate() - .text_size(text(12.)) - .font_weight(FontWeight::SEMIBOLD) - .text_color(tone) - .child(community_name(community).to_string()), - ) - .child( - div() - .text_size(text(11.)) - .text_color(palette.muted) - .child(elapsed_text(since)), - ) - .child(div().flex_1()) - .child( - div() - .id("dock_ping") - .tip("Ping") - .flex_shrink_0() - .h(px(22.)) - .px(px(7.)) - .rounded(px(6.)) - .bg(tone.opacity(0.12)) - .flex() - .items_center() - .gap(px(6.)) - .child(bars) - .child( - div() - .text_size(text(11.)) - .text_color(tone) - .child(format!("{ping:.0} ms")), - ), - ) - .child( - icon_button( - "dock_leave", - palette, - IconName::PhoneOff, - "Leave call", - entity_action(entity, |yumush, _, cx| { - yumush.end_voice(cx); - cx.notify(); - }), - ) - .bg(palette.danger.opacity(0.13)) - .text_color(palette.danger) - .hover(|style| style.bg(palette.danger.opacity(0.22))), - ) - } - - fn dock_voice( - &self, - entity: &Entity, - me: Id, - muted: bool, - deafened: bool, - palette: Palette, - ) -> Div { - let tone = if muted || deafened { - palette.danger - } else { - palette.ok - }; - let deafen_entity = entity.clone(); - let mic_action = entity_action(entity, |yumush, window, cx| yumush.toggle_mute(window, cx)); - let ghost = self.hidden_in_voice(); - let mic_icon = if muted { - IconName::MicOff - } else { - IconName::Mic - }; - let mic_tip = match (muted, ghost) { - (true, true) => "Speak as ghost", - (true, false) => "Unmute", - (false, _) => "Mute", + cx: &App, + ) -> Option { + let community = self.chat.voice_room()?; + let VoiceState::In { .. } = &self.chat.voice_state else { + return None; }; - let deafen_icon = if deafened { - IconName::HeadphoneOff + let (muted, deafened) = self.chat.voice_flags()?; + let user = self.user.as_ref()?; + let me = user.id; + let t = Tokens::of(cx); + let frayed = voice_stats::quality(&self.chat.voice_samples) == Some(Quality::Poor); + let voice = if frayed { + Voice::Frayed + } else if !muted && self.chat.waves.speaking.contains(&me) { + Voice::Live(t.person(me)) } else { - IconName::Headphones + Voice::Quiet }; - let (deafen_bg, deafen_tone, deafen_hover) = if deafened { - ( - palette.danger.opacity(0.13), - palette.danger, - palette.danger.opacity(0.22), - ) - } else { - (palette.hover, palette.text, palette.hover) + let bar = CallBar { + name: user.username.clone().into(), + bands: self.chat.waves.voice(me).cloned(), + voice, + ping: self.chat.voice_samples.back().map(|sample| sample.ping_ms), + muted, + deafened, + camera: self.network.share_source(Kind::Camera).is_some(), + screen: self.network.share_source(Kind::Screen).is_some(), }; - - let voice = div() - .flex_1() - .flex() - .justify_center() - .child(wave::wave_slot( - self.chat.waves.voice(me), - 14., - self.chat.waves.tone(me, Some(me), tone), - )); - let group = hoverable_with( - "dock_mic", - div() - .flex_1() - .h(px(30.)) - .px(px(8.)) - .rounded(px(7.)) - .bg(tone.opacity(0.12)) - .flex() - .items_center() - .gap(px(4.)), - tone.opacity(0.2), - ) - .tip(mic_tip) - .on_click(move |_, window, cx| mic_action(window, cx)) - .child(Icon::new(mic_icon).w(px(14.)).h(px(14.)).text_color(tone)) - .child(voice); - let deafen = icon_button( - format!("dock_deafen_{deafened}"), - palette, - deafen_icon, - if deafened { "Undeafen" } else { "Deafen" }, - move |_, cx| deafen_entity.update(cx, |yumush, cx| yumush.toggle_deafen(cx)), - ) - .w(px(34.)) - .h(px(30.)) - .rounded(px(7.)) - .bg(deafen_bg) - .text_color(deafen_tone) - .hover(move |style| style.bg(deafen_hover)); - - div() - .flex() - .items_center() - .gap(px(4.)) - .child(group) - .child(deafen) - } - - fn dock_devices(&self, entity: &Entity, me: Id, palette: Palette) -> Div { - let (on, off): (Vec, Vec) = [Kind::Camera, Kind::Screen] - .into_iter() - .partition(|kind| self.is_on(*kind)); - let mut rows: Vec
= on - .into_iter() - .map(|kind| self.device_row(entity, me, kind, palette)) - .collect(); - if !off.is_empty() { - rows.push( - div() - .flex() - .items_center() - .gap(px(4.)) - .children(off.into_iter().map(|kind| { - div() - .flex_1() - .flex() - .items_center() - .gap(px(2.)) - .child(start_button(entity, kind, palette)) - .child(self.share_settings_button(entity, palette, kind)) - })), - ); - } - div().flex().flex_col().gap(px(4.)).children(rows) - } - - fn device_row(&self, entity: &Entity, me: Id, kind: Kind, palette: Palette) -> Div { - let tone = tone(palette, kind); - let stop_tip = match kind { - Kind::Camera => "Turn off camera", - Kind::Screen => "Stop sharing", + let (go_id, direct) = (community.id, community.kind.is_direct()); + let actions = CallActions { + mute: Rc::new(entity_action(entity, |yumush, window, cx| { + yumush.toggle_mute(window, cx) + })), + deafen: Rc::new(entity_action(entity, |yumush, _, cx| { + yumush.toggle_deafen(cx) + })), + camera: Rc::new(entity_action(entity, |yumush, window, cx| { + yumush.toggle_camera(window, cx) + })), + screen: Rc::new(entity_action(entity, |yumush, window, cx| { + yumush.toggle_share(window, cx) + })), + leave: Rc::new(entity_action(entity, |yumush, _, cx| { + yumush.end_voice(cx); + cx.notify(); + })), + stats: Rc::new(entity_action(entity, move |yumush, window, cx| { + yumush.go_to_community(go_id, direct, window, cx); + yumush.chat.stats_open = !yumush.chat.stats_open; + cx.notify(); + })), + camera_more: self + .share_settings_button(entity, palette, Kind::Camera, cx) + .into_any_element(), + screen_more: self + .share_settings_button(entity, palette, Kind::Screen, cx) + .into_any_element(), }; - let mut row = div() - .h(px(30.)) - .rounded(px(7.)) - .pl(px(8.)) - .pr(px(2.)) - .bg(tone.opacity(0.1)) - .flex() - .items_center() - .gap(px(4.)) - .child( - Icon::new(kind_icon(kind)) - .w(px(14.)) - .h(px(14.)) - .text_color(tone), - ) - .child( - div() - .text_size(text(11.5)) - .text_color(tone) - .child(self.mode_text(kind)), - ); - if let Some(history) = self.chat.waves.share(me).filter(|_| kind == Kind::Screen) { - row = row.child( - div() - .id("dock_audio") - .tip("Screen audio") - .h(px(20.)) - .px(px(5.)) - .rounded(px(5.)) - .bg(tone.opacity(0.12)) - .flex() - .items_center() - .gap(px(3.)) - .child( - Icon::new(IconName::Volume2) - .w(px(12.)) - .h(px(12.)) - .text_color(tone), - ) - .child(wave::mini_wave(history, 10., tone)), - ); - } - row.child(div().flex_1()) - .child(self.share_settings_button(entity, palette, kind)) - .child( - icon_button( - format!("dock_stop_{kind:?}"), - palette, - IconName::X, - stop_tip, - toggle_action(entity, kind), - ) - .text_color(palette.danger), - ) - } - - fn mode_text(&self, kind: Kind) -> String { - let top = self - .network - .share_source(kind) - .map_or_else(|| self.settings.share.top(kind), |source| source.top); - format!("{}p{}", top.resolution.height(), top.fps.value()) - } - - fn is_on(&self, kind: Kind) -> bool { - self.network.share_source(kind).is_some() - } -} - -fn start_button(entity: &Entity, kind: Kind, palette: Palette) -> Stateful
{ - icon_button( - format!("dock_start_{kind:?}"), - palette, - kind_icon(kind), - match kind { - Kind::Camera => "Turn on camera", - Kind::Screen => "Share screen", - }, - toggle_action(entity, kind), - ) - .flex_1() - .h(px(30.)) - .rounded(px(7.)) - .bg(palette.hover) - .hover(move |style| style.bg(tone(palette, kind).opacity(0.2))) -} - -fn tone(palette: Palette, kind: Kind) -> Hsla { - match kind { - Kind::Camera => palette.camera, - Kind::Screen => palette.screen, - } -} - -fn toggle_action(entity: &Entity, kind: Kind) -> impl Fn(&mut Window, &mut App) + 'static { - let entity = entity.clone(); - move |window: &mut Window, cx: &mut App| match kind { - Kind::Camera => entity.update(cx, |yumush, cx| yumush.toggle_camera(window, cx)), - Kind::Screen => entity.update(cx, |yumush, cx| yumush.toggle_share(window, cx)), - } -} - -fn elapsed_text(since: Instant) -> String { - let seconds = since.elapsed().as_secs(); - let (hours, minutes, seconds) = (seconds / 3600, seconds / 60 % 60, seconds % 60); - match hours { - 0 => format!("{minutes:02}:{seconds:02}"), - _ => format!("{hours}:{minutes:02}:{seconds:02}"), + Some(call_bar::view(bar, actions, t)) } } diff --git a/crates/client/src/gui/gallery.rs b/crates/client/src/gui/gallery.rs index 41d4381..9068fdc 100644 --- a/crates/client/src/gui/gallery.rs +++ b/crates/client/src/gui/gallery.rs @@ -14,6 +14,8 @@ use super::{ style::{Theme, Tokens, size, space}, }; use crate::settings::FontSize; +use super::call_bar::{self, CallActions, CallBar}; +use std::rc::Rc; #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum State { @@ -94,13 +96,15 @@ impl Render for Gallery { let t = Tokens::of(cx); let page = match self.page.as_str() { "parts" => parts_page(self.state, t).into_any_element(), + "call" => call_page(self.state, t).into_any_element(), other => words(format!("no gallery page {other}"), Text::Body, Ink::Bad, t).into_any_element(), }; div() .size_full() + .flex() + .flex_col() .bg(t.ground()) .text_color(t.paper()) - .p(px(space::XXL)) .child(page) } } @@ -187,7 +191,49 @@ fn parts_page(state: State, t: Tokens) -> impl IntoElement { band(space::XXL) .items_start() .size_full() + .p(px(space::XXL)) .child(stack(space::XL).flex_1().child(lines).child(rows)) .child(stack(space::XL).w(px(size::TALK + size::CONTROL)).child(controls).child(pop)) .child(grow()) } + +fn call_page(state: State, t: Tokens) -> impl IntoElement { + let bad = state == State::Bad; + let bar = CallBar { + name: match state { + State::Long => "alice with a name that keeps going past the edge".into(), + State::Empty => "".into(), + _ => "alice".into(), + }, + bands: (state != State::Empty).then(|| bands(1.)), + voice: match state { + State::Bad => Voice::Frayed, + State::Empty => Voice::Quiet, + _ => Voice::Live(t.hue(Hue::Amber)), + }, + ping: match state { + State::Empty => None, + State::Bad => Some(212.), + _ => Some(24.), + }, + muted: bad, + deafened: false, + camera: state == State::Many, + screen: state == State::Many, + }; + let none = || -> call_bar::Action { Rc::new(|_, _| {}) }; + let actions = CallActions { + mute: none(), + deafen: none(), + camera: none(), + screen: none(), + leave: none(), + stats: none(), + camera_more: super::parts::chevron_face(false, t).into_any_element(), + screen_more: super::parts::chevron_face(false, t).into_any_element(), + }; + column() + .size_full() + .child(grow()) + .child(call_bar::view(bar, actions, t)) +} diff --git a/crates/client/src/gui/parts.rs b/crates/client/src/gui/parts.rs index 3676929..943c9b4 100644 --- a/crates/client/src/gui/parts.rs +++ b/crates/client/src/gui/parts.rs @@ -73,12 +73,6 @@ pub fn strong(content: impl Into, style: Text, t: Tokens) -> Div { words(content, style, Ink::Paper, t).font_weight(FontWeight::SEMIBOLD) } -pub fn colored(content: impl Into, style: Text, color: Hsla, t: Tokens) -> Div { - words(content, style, Ink::Paper, t) - .font_weight(FontWeight::MEDIUM) - .text_color(color) -} - pub fn thread(t: Tokens) -> Div { div().w_full().h(px(stroke::LINE)).flex_none().bg(t.thread()) } @@ -250,25 +244,30 @@ pub fn icon_button( .child(Icon::new(icon).size(px(size::ICON))) } -pub fn chevron( - id: impl Into, - open: bool, - t: Tokens, - on_click: impl Fn(&mut Window, &mut App) + 'static, -) -> Stateful
{ +pub fn chevron_face(open: bool, t: Tokens) -> Div { div() - .id(id) - .cursor_pointer() .w(px(16.)) .h(px(size::CONTROL)) .flex() + .flex_none() .items_center() .justify_center() + .cursor_pointer() .text_color(if open { t.paper() } else { t.faint() }) - .on_click(move |_, window, cx| on_click(window, cx)) .child(Icon::new(IconName::ChevronUp).size(px(13.))) } +pub fn chevron( + id: impl Into, + open: bool, + t: Tokens, + on_click: impl Fn(&mut Window, &mut App) + 'static, +) -> Stateful
{ + chevron_face(open, t) + .id(id) + .on_click(move |_, window, cx| on_click(window, cx)) +} + pub fn popover(t: Tokens) -> Div { column() .bg(t.raise()) @@ -366,7 +365,3 @@ fn sample(levels: &[f32], along: f32) -> f32 { pub fn spark(values: Vec, slots: usize, color: Hsla) -> AnyElement { super::wave::line_of(values, slots, color).into_any_element() } - -pub fn person(content: impl Into, hue: Hsla, t: Tokens) -> Div { - colored(content, Text::Ui, hue, t).font_weight(FontWeight::SEMIBOLD) -} diff --git a/crates/client/src/gui/share_view.rs b/crates/client/src/gui/share_view.rs index ae20090..b86ac7a 100644 --- a/crates/client/src/gui/share_view.rs +++ b/crates/client/src/gui/share_view.rs @@ -466,6 +466,7 @@ impl Yumush { entity: &Entity, palette: Palette, kind: Kind, + cx: &App, ) -> impl IntoElement { let refresh = entity.clone(); let settings = entity.clone(); @@ -483,10 +484,10 @@ impl Yumush { }; Popover::new(id) - .anchor(Anchor::BottomLeft) + .anchor(Anchor::BottomRight) .appearance(false) .trigger(Trigger::new( - div() + super::parts::chevron_face(false, super::style::Tokens::of(cx)) .id(button) .on_mouse_down(MouseButton::Left, move |_, _, cx| { refresh.update(cx, |yumush, cx| { @@ -497,23 +498,14 @@ impl Yumush { } }); }) - .tip(tip) - .size(px(22.)) - .flex() - .flex_shrink_0() - .items_center() - .justify_center() - .rounded(px(6.)) - .text_color(palette.muted) - .hover(|style| style.bg(palette.hover).text_color(palette.text)) - .child(Icon::new(IconName::ChevronDown).w(px(13.)).h(px(13.))), + .tip(tip), )) .content(move |_, _, cx| { let entity = settings.clone(); pop_in( "share_settings_card", settings_card(&entity, entity.read(cx), palette), - Anchor::BottomLeft, + Anchor::BottomRight, ) }) } diff --git a/crates/client/src/gui/sidebar.rs b/crates/client/src/gui/sidebar.rs index fcebb35..62140ec 100644 --- a/crates/client/src/gui/sidebar.rs +++ b/crates/client/src/gui/sidebar.rs @@ -135,7 +135,6 @@ impl Yumush { .overflow_y_scroll() .child(list), ) - .children(self.dock(entity, palette)) .children(self.account_row(entity, palette)) .into_any_element() } diff --git a/crates/client/src/gui/style.rs b/crates/client/src/gui/style.rs index f4bfd61..77e4630 100644 --- a/crates/client/src/gui/style.rs +++ b/crates/client/src/gui/style.rs @@ -125,7 +125,7 @@ mod tests { assert_eq!(names, HUE_NAMES); } - const UNMIGRATED: [&str; 37] = [ + const UNMIGRATED: [&str; 36] = [ "gui.rs", "gui/auth.rs", "gui/builder.rs", @@ -145,7 +145,6 @@ mod tests { "gui/chat.rs", "gui/community_settings.rs", "gui/composer.rs", - "gui/dock.rs", "gui/forward.rs", "gui/media_view.rs", "gui/message_actions.rs", diff --git a/crates/client/src/gui/wave.rs b/crates/client/src/gui/wave.rs index a45af63..ca685ff 100644 --- a/crates/client/src/gui/wave.rs +++ b/crates/client/src/gui/wave.rs @@ -149,15 +149,6 @@ impl Waves { } } -pub fn wave_slot(history: Option<&VecDeque>, size: f32, color: Hsla) -> Div { - slot( - spectrum::BANDS, - history.map(|history| history.iter().copied().collect()), - size, - color, - ) -} - pub fn mini_wave(history: &VecDeque, size: f32, color: Hsla) -> Div { let group = history.len().div_ceil(MINI_BARS).max(1); let bars: Vec = history diff --git a/harness/compare.sh b/harness/compare.sh index 7f6ce0c..3eede32 100755 --- a/harness/compare.sh +++ b/harness/compare.sh @@ -8,7 +8,7 @@ out="$STATE/shots/gallery" size=1120,720 [ "$state" = narrow ] && size=800,600 profile="$(mktemp -d -p "$STATE")" -firefox --headless --profile "$profile" --window-size "$size" --screenshot "$out/$page-$state-artifact.png" "file://$artifact#$state" >/dev/null 2>&1 +firefox --headless --profile "$profile" --window-size "$size" --screenshot "$out/$page-$state-artifact.png" "file://$artifact#$page:$state" >/dev/null 2>&1 rm -rf "$profile" magick montage "$out/$page-$state-artifact.png" "$out/$page-$state.png" -tile 2x1 -geometry +8+8 -background '#808080' "$out/$page-$state-compare.png" echo "$out/$page-$state-compare.png"