Skip to content

A fast file manager for Windows and macOS that never freezes: tabs, dual panes, archives as folders, Quick Look-style previews. A File Explorer and Finder alternative written in Rust.

Update card: smooth sweep while checking, no stuttering highlight while downloading

gelenmedyaa1a83cfe7f9c
diff --git a/crates/rf-app/src/settings_view.rs b/crates/rf-app/src/settings_view.rs
index f6d55fb3..98bcd80d 100644
--- a/crates/rf-app/src/settings_view.rs
+++ b/crates/rf-app/src/settings_view.rs
@@ -4471,10 +4471,16 @@ fn update_card(p: &Palette, s: &Settings) -> AnyElement {
// behind the row: a light sweeping while checking, a bar filling while downloading, full when done
let tint = p.accent;
let layer = match state {
+ // Checking lasts a second or two: the sweep runs at the display's rate for that short while. Drawn at the slow redraw's
+ // pace it stuttered at about 5 frames a second (user, 2026-12-04).
State::Checking => Some(
glow(tint, 0.22)
.w(relative(0.3))
- .left(relative(-0.3 + 1.3 * sweep(1200)))
+ .with_animation(
+ "upd-sweep",
+ Animation::new(std::time::Duration::from_millis(1200)).repeat().with_easing(ease_in_out),
+ |el, t| el.left(relative(-0.3 + 1.3 * t)),
+ )
.into_any_element(),
),
State::Downloading(_, pct) => Some(
@@ -4485,11 +4491,9 @@ fn update_card(p: &Palette, s: &Settings) -> AnyElement {
.left_0()
.w(relative(pct as f32 / 100.0))
.overflow_hidden()
+ // (no running highlight: a download can take minutes, and at the slow redraw's pace it stuttered; the bar's own
+ // growth is the motion)
.bg(tint.opacity(0.18))
- .child(
- // a soft highlight running along the filled part
- glow(tint, 0.2).w(px(120.)).left(relative(-0.2 + 1.2 * sweep(1000))),
- )
.into_any_element(),
),
State::Ready(_) => Some(div().absolute().inset_0().bg(tint.opacity(0.14)).into_any_element()),
@@ -4512,23 +4516,6 @@ fn glow(c: Hsla, alpha: f32) -> Div {
div().absolute().top_0().bottom_0().flex().child(half(0., alpha)).child(half(alpha, 0.))
}
-/// How far a band of light has travelled (0..1) after `period` milliseconds, read when the card is drawn.
-///
-/// WHY NOT `with_animation(..).repeat()`: a repeating animation asks for a frame at the display's rate for as long as it runs, so
-/// checking for or downloading an update kept a whole core busy (about 50 % here). The card is redrawn a few times a second
-/// meanwhile (`installer::redraw_while_busy`), so the light still moves, at that rate, for next to nothing.
-fn sweep(period_ms: u64) -> f32 {
- let now = std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).map_or(0, |d| d.as_millis());
- let t = (now % u128::from(period_ms)) as f32 / period_ms as f32;
- // ease in and out, as the animation did
- if t < 0.5 {
- 2.0 * t * t
- } else {
- let x = -2.0 * t + 2.0;
- 1.0 - x * x / 2.0
- }
-}
-
/// "Check for updates": runs off the UI thread and redraws while it checks, and downloads what it finds only while "Download
/// updates automatically" is on (off: the card offers a Download button, `installer::check`).
pub(crate) fn check_updates_now(cx: &mut App) {