fix(ui): read ticks share one baseline, compact name plates on small call tiles
- done_all glyph moved down to the bottom of the single tick, both end on the time baseline - tiles under 200 px high: 11 px name, 4 px inset, at most 60% of the width - drop an unused import Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@@ -1 +1 @@
1
<svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" width="20"><path d="M293-301.85 113.85-482l35.77-36.15 143 142L306.46-390l37.16 37.15-50.62 51Zm204 0L316.85-482 354-518.77l143 143 324-324L858.15-663 497-301.85ZM483.15-491l-36.77-37.15 172-172L655.15-663l-172 172Z"/></svg>
1
<svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -981 960 960" width="20"><path d="M293-301.85 113.85-482l35.77-36.15 143 142L306.46-390l37.16 37.15-50.62 51Zm204 0L316.85-482 354-518.77l143 143 324-324L858.15-663 497-301.85ZM483.15-491l-36.77-37.15 172-172L655.15-663l-172 172Z"/></svg>
@@ -1 +1 @@1
<svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" width="20"><path d="M293-301.85 113.85-482l35.77-36.15 143 142L306.46-390l37.16 37.15-50.62 51Zm204 0L316.85-482 354-518.77l143 143 324-324L858.15-663 497-301.85ZM483.15-491l-36.77-37.15 172-172L655.15-663l-172 172Z"/></svg>1
<svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -981 960 960" width="20"><path d="M293-301.85 113.85-482l35.77-36.15 143 142L306.46-390l37.16 37.15-50.62 51Zm204 0L316.85-482 354-518.77l143 143 324-324L858.15-663 497-301.85ZM483.15-491l-36.77-37.15 172-172L655.15-663l-172 172Z"/></svg>@@ -55,6 +55,7 @@ const BLINK_DIMMED_OPACITY: f32 = 0.45;
55
55
pub(super) const DISABLED_OPACITY: f32 = 0.4;
56
56
const TILE_RADIUS: f32 = 12.;
57
57
const NAME_PLATE_BACKGROUND: f32 = 0.6;
58
const COMPACT_PLATE_BELOW: f32 = 200.;
58
59
pub const CHAT_PANEL_TAG: &str = "shell/islands/main/call-chat-panel";
59
60
pub const NO_MICROPHONE_HINT: &str = "No microphone found";
60
61
const AUDIO_OFF_HINT: &str = "Audio is off for this meeting";
@@ -237,6 +238,41 @@ fn mute_badge() -> Div {
237
238
.child(icon(IconName::MicOff, 13., theme::white()))
238
239
}
239
240
241
struct NamePlate {
242
inset: f32,
243
padding_x: f32,
244
padding_y: f32,
245
radius: f32,
246
text_size: f32,
247
max_width_share: f32,
248
}
249
250
fn name_plate_metrics(size: TileSize) -> NamePlate {
251
if size.height < COMPACT_PLATE_BELOW {
252
NamePlate { inset: 4., padding_x: 6., padding_y: 2., radius: 4., text_size: 11., max_width_share: 0.6 }
253
} else {
254
NamePlate { inset: 8., padding_x: 8., padding_y: 4., radius: 6., text_size: 12., max_width_share: 1. }
255
}
256
}
257
258
fn name_plate(size: TileSize, name: &str) -> Div {
259
let plate = name_plate_metrics(size);
260
div()
261
.absolute()
262
.left(px(plate.inset))
263
.bottom(px(plate.inset))
264
.max_w(px(((size.width - 3. * plate.inset) * plate.max_width_share).max(0.)))
265
.truncate()
266
.px(px(plate.padding_x))
267
.py(px(plate.padding_y))
268
.rounded(px(plate.radius))
269
.bg(hsla(0., 0., 0., NAME_PLATE_BACKGROUND))
270
.text_size(px(plate.text_size))
271
.font_weight(FontWeight::SEMIBOLD)
272
.text_color(theme::white())
273
.child(name.to_owned())
274
}
275
240
276
fn video_tile(
241
277
size: TileSize,
242
278
image: Arc<RenderImage>,
@@ -269,22 +305,7 @@ fn video_tile(
269
305
})
270
306
.rounded(px(TILE_RADIUS)),
271
307
)
272
.child(
273
div()
274
.absolute()
275
.left(px(8.))
276
.bottom(px(8.))
277
.max_w(px(size.width - 24.))
278
.truncate()
279
.px(px(8.))
280
.py(px(4.))
281
.rounded(px(6.))
282
.bg(hsla(0., 0., 0., NAME_PLATE_BACKGROUND))
283
.text_size(px(12.))
284
.font_weight(FontWeight::SEMIBOLD)
285
.text_color(theme::white())
286
.child(name.to_owned()),
287
)
308
.child(name_plate(size, name))
288
309
.when(muted, |tile| tile.child(mute_badge()))
289
310
.children(tile_overlays(extras))
290
311
}
@@ -1483,3 +1504,17 @@ pub fn side_panel(
1483
1504
)
1484
1505
.child(body)
1485
1506
}
1507
1508
#[cfg(test)]
1509
mod tests {
1510
use super::{TileSize, name_plate_metrics};
1511
1512
#[test]
1513
fn small_strip_tiles_get_a_compact_name_plate() {
1514
let strip = name_plate_metrics(TileSize { width: 216., height: 121.5, avatar: 48. });
1515
assert_eq!((strip.text_size, strip.inset, strip.padding_y), (11., 4., 2.));
1516
assert!(strip.max_width_share < 1.);
1517
let stage = name_plate_metrics(TileSize { width: 640., height: 360., avatar: 96. });
1518
assert_eq!((stage.text_size, stage.inset), (12., 8.));
1519
}
1520
}
@@ -55,6 +55,7 @@ const BLINK_DIMMED_OPACITY: f32 = 0.45;55
pub(super) const DISABLED_OPACITY: f32 = 0.4;55
pub(super) const DISABLED_OPACITY: f32 = 0.4;56
const TILE_RADIUS: f32 = 12.;56
const TILE_RADIUS: f32 = 12.;57
const NAME_PLATE_BACKGROUND: f32 = 0.6;57
const NAME_PLATE_BACKGROUND: f32 = 0.6;58
const COMPACT_PLATE_BELOW: f32 = 200.;58
pub const CHAT_PANEL_TAG: &str = "shell/islands/main/call-chat-panel";59
pub const CHAT_PANEL_TAG: &str = "shell/islands/main/call-chat-panel";59
pub const NO_MICROPHONE_HINT: &str = "No microphone found";60
pub const NO_MICROPHONE_HINT: &str = "No microphone found";60
const AUDIO_OFF_HINT: &str = "Audio is off for this meeting";61
const AUDIO_OFF_HINT: &str = "Audio is off for this meeting";@@ -237,6 +238,41 @@ fn mute_badge() -> Div {237
.child(icon(IconName::MicOff, 13., theme::white()))238
.child(icon(IconName::MicOff, 13., theme::white()))238
}239
}239
240
241
struct NamePlate {242
inset: f32,243
padding_x: f32,244
padding_y: f32,245
radius: f32,246
text_size: f32,247
max_width_share: f32,248
}249
250
fn name_plate_metrics(size: TileSize) -> NamePlate {251
if size.height < COMPACT_PLATE_BELOW {252
NamePlate { inset: 4., padding_x: 6., padding_y: 2., radius: 4., text_size: 11., max_width_share: 0.6 }253
} else {254
NamePlate { inset: 8., padding_x: 8., padding_y: 4., radius: 6., text_size: 12., max_width_share: 1. }255
}256
}257
258
fn name_plate(size: TileSize, name: &str) -> Div {259
let plate = name_plate_metrics(size);260
div()261
.absolute()262
.left(px(plate.inset))263
.bottom(px(plate.inset))264
.max_w(px(((size.width - 3. * plate.inset) * plate.max_width_share).max(0.)))265
.truncate()266
.px(px(plate.padding_x))267
.py(px(plate.padding_y))268
.rounded(px(plate.radius))269
.bg(hsla(0., 0., 0., NAME_PLATE_BACKGROUND))270
.text_size(px(plate.text_size))271
.font_weight(FontWeight::SEMIBOLD)272
.text_color(theme::white())273
.child(name.to_owned())274
}275
240
fn video_tile(276
fn video_tile(241
size: TileSize,277
size: TileSize,242
image: Arc<RenderImage>,278
image: Arc<RenderImage>,@@ -269,22 +305,7 @@ fn video_tile(269
})305
})270
.rounded(px(TILE_RADIUS)),306
.rounded(px(TILE_RADIUS)),271
)307
)272
.child(308
.child(name_plate(size, name))273
div()274
.absolute()275
.left(px(8.))276
.bottom(px(8.))277
.max_w(px(size.width - 24.))278
.truncate()279
.px(px(8.))280
.py(px(4.))281
.rounded(px(6.))282
.bg(hsla(0., 0., 0., NAME_PLATE_BACKGROUND))283
.text_size(px(12.))284
.font_weight(FontWeight::SEMIBOLD)285
.text_color(theme::white())286
.child(name.to_owned()),287
)288
.when(muted, |tile| tile.child(mute_badge()))309
.when(muted, |tile| tile.child(mute_badge()))289
.children(tile_overlays(extras))310
.children(tile_overlays(extras))290
}311
}@@ -1483,3 +1504,17 @@ pub fn side_panel(1483
)1504
)1484
.child(body)1505
.child(body)1485
}1506
}1507
1508
#[cfg(test)]1509
mod tests {1510
use super::{TileSize, name_plate_metrics};1511
1512
#[test]1513
fn small_strip_tiles_get_a_compact_name_plate() {1514
let strip = name_plate_metrics(TileSize { width: 216., height: 121.5, avatar: 48. });1515
assert_eq!((strip.text_size, strip.inset, strip.padding_y), (11., 4., 2.));1516
assert!(strip.max_width_share < 1.);1517
let stage = name_plate_metrics(TileSize { width: 640., height: 360., avatar: 96. });1518
assert_eq!((stage.text_size, stage.inset), (12., 8.));1519
}1520
}@@ -1,5 +1,5 @@
1
1
use gpui_kit::assets::IconName;
2
use gpui_kit::component::{Icon, h_flex, v_flex};
2
use gpui_kit::component::{h_flex, v_flex};
3
3
use gpui_kit::prelude::FluentBuilder as _;
4
4
use gpui_kit::*;
5
5
use std::time::Duration;
@@ -1,5 +1,5 @@1
use gpui_kit::assets::IconName;1
use gpui_kit::assets::IconName;2
use gpui_kit::component::{Icon, h_flex, v_flex};2
use gpui_kit::component::{h_flex, v_flex};3
use gpui_kit::prelude::FluentBuilder as _;3
use gpui_kit::prelude::FluentBuilder as _;4
use gpui_kit::*;4
use gpui_kit::*;5
use std::time::Duration;5
use std::time::Duration;