feat(home): sort control for the Library Albums rail
Adds a compact dropdown in the Library Albums (favoriteAlbums) row header, left of the page chevrons: Recently added (default), First added (reverse), Random (shuffle). Reorders the cached base list in Rust with no re-fetch and re-fires artwork by the new index. Also corrects the stale HomeView comment that claimed the recently-played refresh lives in the toolbar (it is a row-header button). 8 locales updated. cc
This commit is contained in:
13 files changed
+202
-5
No files matched your search
@@ -121,9 +121,10 @@ component GenreButton inherits Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
// Manual refresh for the recently-played rails — sits in the toolbar next
|
||||
// to the nav cluster. Same 32px icon-button form as GearButton, plus the
|
||||
// global hover tooltip (TooltipState — the TransportControls pattern).
|
||||
// Settings/config gear for the Home configurator, anchored in the toolbar's
|
||||
// right controls. (The recently-played refresh is NOT here — it lives in each
|
||||
// recently-played row header, left of the page chevrons; see Carousel
|
||||
// `show-refresh`.)
|
||||
component GearButton inherits Rectangle {
|
||||
callback clicked();
|
||||
|
||||
@@ -461,6 +462,18 @@ export component HomeView inherits Rectangle {
|
||||
if desc.id == "favoriteAlbums"
|
||||
&& HomeState.favorite-albums.albums.length > 0: Carousel {
|
||||
section: HomeState.favorite-albums;
|
||||
// Sort dropdown left of the page chevrons (#566).
|
||||
show-sort: true;
|
||||
sort-options: [
|
||||
@tr("Recently added"),
|
||||
@tr("First added"),
|
||||
@tr("Random"),
|
||||
];
|
||||
sort-index: HomeState.library-albums-sort;
|
||||
sort-changed(i) => {
|
||||
HomeState.library-albums-sort = i;
|
||||
HomeActions.set-library-albums-sort(i);
|
||||
}
|
||||
album-clicked(id) => {
|
||||
root.album-clicked(id);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user