Media: the caption outlasts the bar; one Space per press; narrow boxes hold

Only the bar fades now, so the caption stays while the controls rest, and
the caption chip can shrink, so a long line wraps inside a narrow player.
A focused media button keeps Space to itself, since gpui presses it on
the release. The player and the strip let Command and Control letters
pass. The scrubber's tip splits the free width by the pointer's share and
stays over the track at both ends. An inline edit's label gives way with
an ellipsis beside fixed parts.

The player is a Tab stop only when a key does something, logs its
captions, keys its fade by its own id, and logs a failed wake.
This commit is contained in:
ZacharyZhang-NY committed 2026-09-26 17:52:27 -04:00
1 parent d125314d39
commit f8fcfa2870
9 files changed
+272 -86

No files matched your search

+12 -1
View File
@@ -10,6 +10,7 @@ use super::{Input, InputEvent, TextInput};
use crate::{
primitives::{FocusRing, Icon, IconName, tab_stop},
theme::{ActiveTheme, ControlSize, IconSize, Radius},
typography::Ellipsis,
};
pub(crate) type OnCommit = Rc<dyn Fn(&SharedString, &mut Window, &mut App)>;
@@ -155,6 +156,15 @@ impl RenderOnce for InlineEdit {
let empty = self.value.is_empty();
let (value, start, back) = (self.value.clone(), state, focus.clone());
let group = SharedString::from(format!("inline-edit-{:?}", self.id));
let label = div()
.debug_selector(|| format!("inline-edit {}", self.id))
.flex_1()
.min_w_0()
.child(Ellipsis::new(if empty {
self.placeholder
} else {
self.value
}));
div()
.id(self.id)
.group(group.clone())
@@ -177,9 +187,10 @@ impl RenderOnce for InlineEdit {
start.update(cx, |editing, _| editing.returning(back.clone()));
Editing::begin(&start, value.to_string(), window, cx);
})
.child(if empty { self.placeholder } else { self.value })
.child(label)
.child(
div()
.flex_none()
.invisible()
.group_hover(group, |style| style.visible())
.child(