fix(slint): search refinements — artist card, history, spinner, hover
- ArtistCard rebuilt 1:1 with Tauri SearchView.artist-card: 160x220 inside a surface-card container, 12px corners, 120px circular avatar with a gradient placeholder, hover swaps to surface-elevated. The Follow chip (rectangular per ADR-008) sits below the name when the user does not follow the artist. - Search loading state uses a rotating spinner (Lucide LoaderCircle on Slint transform-rotation) matching the Tauri spinner — 1s linear infinite. The search header (title + tabs + filter radios) collapses while the initial load runs so the chrome does not show through. - Search history: live debounce + submit now use nav::push_or_replace_search, so the latest query is the single Search entry in history. Back from an opened album lands on that search. - Track row backgrounds use the OR-d row-hovered (cell / fav / dl / more), so hovering the more button no longer drops the row tint. - replace_category artists arm re-applies the top-result dedupe, so filtering does not bring the duplicate back. cc
This commit is contained in:
11 files changed
+129
-43
No files matched your search
@@ -33,6 +33,27 @@ thread_local! {
|
||||
});
|
||||
}
|
||||
|
||||
/// Push a Search history entry, OR replace the cursor entry in place
|
||||
/// when it is already a Search. Used by the live-search debounce so
|
||||
/// quick keystrokes do not push one entry per character, while still
|
||||
/// keeping the page reachable via back/forward at the final query.
|
||||
pub fn push_or_replace_search(query: String) {
|
||||
HISTORY.with(|h| {
|
||||
let h = &mut *h.borrow_mut();
|
||||
match h.entries.get(h.cursor) {
|
||||
Some(NavEntry::Search(_)) => {
|
||||
h.entries.truncate(h.cursor + 1);
|
||||
h.entries[h.cursor] = NavEntry::Search(query);
|
||||
}
|
||||
_ => {
|
||||
h.entries.truncate(h.cursor + 1);
|
||||
h.entries.push(NavEntry::Search(query));
|
||||
h.cursor = h.entries.len() - 1;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/// Record a fresh forward navigation, dropping any forward history. A
|
||||
/// no-op when the destination already is the current entry, so repeated
|
||||
/// clicks on the same page do not pile up.
|
||||
|
||||
Reference in new issue
Block a user