Media: the player's bar fades by elapsed time, so its scrubber and buttons keep their state

The fade restarted an animation id at each rest and wake, and gpui hands
that id to every descendant: the scrubber's drag, hover and focus handle
and the buttons' focus were rebuilt under it. The bar's opacity now reads
the time since the last change through motion::since_change. The stage
tracks focus even without key handlers, so a focused bar button keeps
the bar up. The player's tests move to their own file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-09-26 18:14:06 -04:00
1 parent fbf99ed4f7
commit fcb1b2d9df
8 files changed
+330 -220

No files matched your search

+1 -1
View File
@@ -26,7 +26,7 @@ const RING: Duration = Duration::from_millis(1_600);
const PACE: f32 = 40.0;
/// How far into its effect a change is, 0 to 1, and whether it still moves; it asks for the next frame while it does.
fn since_change<K: Clone + PartialEq + 'static>(
pub(crate) fn since_change<K: Clone + PartialEq + 'static>(
id: &ElementId,
key: K,
length: Duration,
+1
View File
@@ -16,6 +16,7 @@ mod tests;
pub(crate) use changes::changes;
pub use curve::*;
pub(crate) use effects::since_change;
pub use effects::{Blink, Flash, Glow, Marquee, Pulse, Shake};
pub use list::{AnimatePresence, Flip};
pub use overlay::{LazyLoad, LoadingOverlay, Refresh, RefreshIndicator, TypingIndicator};