// B9 — "playable favorites" rail, shown INSIDE the offline placeholder on // the Favorites view only (the AppShell mounts it as the placeholder's // children — ADR-010: both `if`s live at the AppShell mount site). Lists // the favorite tracks that are still playable offline (offline-cache READY // copies + library qobuz_download rows, intersected with the disk-seeded // favorite set on the Rust side) as compact SlimCard rows; clicking a row // plays the whole rail from there through the offline-capable queue path. // // Collapses to nothing while the list is empty, so the placeholder then // reads exactly like the generic one. import { Theme } from "../foundation/semantic-colors.slint"; import { Typography } from "../foundation/typography.slint"; import { OfflineFavoritesState, OfflineFavoritesActions } from "../state.slint"; import { SlimCard } from "../discover/SlimCard.slint"; import { ListView } from "std-widgets.slint"; export component FavoritesOfflineRail inherits VerticalLayout { init => { OfflineFavoritesActions.load(); } property count: OfflineFavoritesState.tracks.length; if root.count > 0: Rectangle { height: 28px; } if root.count > 0: HorizontalLayout { alignment: center; VerticalLayout { spacing: 12px; // Canonical section heading (Typography.section, semibold) flush // with the cards' outer edge — same idiom as GridSection. Text { text: @tr("Available offline") + " (\{root.count})"; color: Theme.text-primary; font-size: Typography.section; font-weight: Typography.semibold; } ListView { width: 480px; // Up to five 60px rows visible; longer lists scroll inside. height: Math.min(root.count, 5) * 60px; for item in OfflineFavoritesState.tracks: SlimCard { item: item; clicked(id) => { OfflineFavoritesActions.play(id); } } } } } }