Port the Tauri LabelView module to native Slint, reusing existing components and extending where needed (no duplication). Landing (new LabelPageView): circular header + description read-more + Follow toggle, sticky JUMP TO bar, Popular Tracks (multi-select, 5->20->50 reveal, Play all), and Releases (+ See all) / Critics' Picks / Playlists / Artists / More Labels carousels. All Releases sub-view (LabelReleasesView): circular header + album count, toolbar (local search, group-by-artist, Hi-Res filter, sort) + grid/list toggle, load-more, states. TYPE column now populated. Split the label route: ContentView::label -> LabelPageView (landing), ContentView::label-releases -> LabelReleasesView; add NavEntry::LabelReleases. label.rs load_label_page parses /label/page + getAlbums + explore + the favorite-labels set; derive_releases re-derives the sub-view list. Reuse Carousel/PlaylistCarousel/ArtistCarousel/TrackRow/AlbumCard/ AlbumListRow/JumpNavBar/QbzSelect/ExpandableSearch; extend ArtistCard/ ArtistCarousel (follow-mode/follow-kind); promote CircleAction to a shared primitive; JumpNavBar gains show-search. Wire label media-actions: follow, play-top, open (more-labels), see-all. cc
282 lines
11 KiB
Plaintext
282 lines
11 KiB
Plaintext
// App shell — the post-login frame: header bar, sidebar, content
|
|
// region, and player bar. The content region shows the Discover Home,
|
|
// Album detail, or Artist detail view, driven by NavState.
|
|
//
|
|
// Regions are delineated by their surface colors (chrome over the darker
|
|
// content well); no hairline borders.
|
|
|
|
import { Theme } from "../foundation/semantic-colors.slint";
|
|
import { NavState, ContentView, ShellState } from "../state.slint";
|
|
import { Sidebar } from "Sidebar.slint";
|
|
import { HeaderBar } from "HeaderBar.slint";
|
|
import { HeaderMenuOverlay } from "HeaderMenuOverlay.slint";
|
|
import { PlaylistPickerModal } from "../primitives/PlaylistPickerModal.slint";
|
|
import { CreatePlaylistModal } from "../primitives/CreatePlaylistModal.slint";
|
|
import { EditPlaylistModal } from "../primitives/EditPlaylistModal.slint";
|
|
import { CreateFolderModal } from "../primitives/CreateFolderModal.slint";
|
|
import { FolderEditModal } from "../primitives/FolderEditModal.slint";
|
|
import { DragGhost } from "../primitives/DragGhost.slint";
|
|
import { PlayerBar } from "PlayerBar.slint";
|
|
import { QueueSidebar } from "QueueSidebar.slint";
|
|
import { LyricsSidebar } from "LyricsSidebar.slint";
|
|
import { HomeView } from "../discover/HomeView.slint";
|
|
import { DiscoverBrowseView } from "../discover/DiscoverBrowseView.slint";
|
|
import { AlbumPageView } from "../album/AlbumPageView.slint";
|
|
import { ArtistPageView } from "../artist/ArtistPageView.slint";
|
|
import { MusicianPageView } from "../musician/MusicianPageView.slint";
|
|
import { LabelReleasesView } from "../label/LabelReleasesView.slint";
|
|
import { LabelPageView } from "../label/LabelPageView.slint";
|
|
import { ArtistsByLocationView } from "../location/ArtistsByLocationView.slint";
|
|
import { FavoritesView } from "../favorites/FavoritesView.slint";
|
|
import { MixView } from "../mix/MixView.slint";
|
|
import { PlaylistView } from "../playlist/PlaylistView.slint";
|
|
import { PlaylistManagerView } from "../playlist/PlaylistManagerView.slint";
|
|
import { SettingsView } from "../settings/SettingsView.slint";
|
|
import { SearchResultsView } from "../search/SearchResultsView.slint";
|
|
|
|
export component AppShell inherits Rectangle {
|
|
callback open-album(string);
|
|
callback open-artist(string);
|
|
callback media-action(string, string, string);
|
|
callback header-menu-navigate(string);
|
|
callback discover-view-all(string, string);
|
|
callback settings-bool(string, bool);
|
|
callback settings-select(string, int);
|
|
callback settings-slider(string, int);
|
|
callback settings-reset();
|
|
callback logout();
|
|
callback close-app();
|
|
|
|
background: Theme.surface-main;
|
|
|
|
// Bottom layer: catches the mouse back / forward buttons for history
|
|
// navigation. Declared first so the real UI sits on top of it.
|
|
TouchArea {
|
|
pointer-event(e) => {
|
|
if (e.kind == PointerEventKind.down) {
|
|
if (e.button == PointerEventButton.back) {
|
|
NavState.request-back();
|
|
}
|
|
if (e.button == PointerEventButton.forward) {
|
|
NavState.request-forward();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
VerticalLayout {
|
|
spacing: 0px;
|
|
|
|
HeaderBar {
|
|
logout => {
|
|
root.logout();
|
|
}
|
|
close-app => {
|
|
root.close-app();
|
|
}
|
|
}
|
|
|
|
HorizontalLayout {
|
|
vertical-stretch: 1;
|
|
spacing: 0px;
|
|
|
|
Sidebar { }
|
|
|
|
// Content region — Home, Album, or Artist.
|
|
Rectangle {
|
|
horizontal-stretch: 1;
|
|
background: Theme.surface-main;
|
|
|
|
if NavState.view == ContentView.home: HomeView {
|
|
album-clicked(id) => {
|
|
root.open-album(id);
|
|
}
|
|
open-artist(id) => {
|
|
root.open-artist(id);
|
|
}
|
|
media-action(kind, id, action) => {
|
|
root.media-action(kind, id, action);
|
|
}
|
|
discover-view-all(e, t) => {
|
|
root.discover-view-all(e, t);
|
|
}
|
|
}
|
|
if NavState.view == ContentView.discover-browse: DiscoverBrowseView {
|
|
open-album(id) => {
|
|
root.open-album(id);
|
|
}
|
|
open-artist(id) => {
|
|
root.open-artist(id);
|
|
}
|
|
media-action(kind, id, action) => {
|
|
root.media-action(kind, id, action);
|
|
}
|
|
}
|
|
if NavState.view == ContentView.album: AlbumPageView {
|
|
open-artist(id) => {
|
|
root.open-artist(id);
|
|
}
|
|
media-action(kind, id, action) => {
|
|
root.media-action(kind, id, action);
|
|
}
|
|
}
|
|
if NavState.view == ContentView.artist: ArtistPageView {
|
|
open-album(id) => {
|
|
root.open-album(id);
|
|
}
|
|
media-action(kind, id, action) => {
|
|
root.media-action(kind, id, action);
|
|
}
|
|
}
|
|
if NavState.view == ContentView.musician: MusicianPageView {
|
|
open-album(id) => {
|
|
root.open-album(id);
|
|
}
|
|
}
|
|
if NavState.view == ContentView.label: LabelPageView {
|
|
open-album(id) => {
|
|
root.open-album(id);
|
|
}
|
|
open-artist(id) => {
|
|
root.open-artist(id);
|
|
}
|
|
media-action(kind, id, action) => {
|
|
root.media-action(kind, id, action);
|
|
}
|
|
}
|
|
if NavState.view == ContentView.label-releases: LabelReleasesView {
|
|
open-album(id) => {
|
|
root.open-album(id);
|
|
}
|
|
open-artist(id) => {
|
|
root.open-artist(id);
|
|
}
|
|
media-action(kind, id, action) => {
|
|
root.media-action(kind, id, action);
|
|
}
|
|
}
|
|
if NavState.view == ContentView.location: ArtistsByLocationView {
|
|
open-artist(id) => {
|
|
root.open-artist(id);
|
|
}
|
|
}
|
|
if NavState.view == ContentView.favorites: FavoritesView {
|
|
open-album(id) => {
|
|
root.open-album(id);
|
|
}
|
|
open-artist(id) => {
|
|
root.open-artist(id);
|
|
}
|
|
}
|
|
if NavState.view == ContentView.playlist-manager: PlaylistManagerView { }
|
|
if NavState.view == ContentView.mix: MixView {
|
|
play-track(id) => {
|
|
root.media-action("mix-track", id, "play");
|
|
}
|
|
play-all => {
|
|
root.media-action("mix", "", "play-all");
|
|
}
|
|
shuffle => {
|
|
root.media-action("mix", "", "shuffle");
|
|
}
|
|
refresh => {
|
|
root.media-action("mix", "", "refresh");
|
|
}
|
|
media-action(kind, id, action) => {
|
|
root.media-action(kind, id, action);
|
|
}
|
|
}
|
|
if NavState.view == ContentView.playlist: PlaylistView {
|
|
play-track(id) => {
|
|
root.media-action("playlist-track", id, "play");
|
|
}
|
|
play-all => {
|
|
root.media-action("playlist", "", "play-all");
|
|
}
|
|
shuffle => {
|
|
root.media-action("playlist", "", "shuffle");
|
|
}
|
|
toggle-favorite => {
|
|
root.media-action("playlist", "", "favorite");
|
|
}
|
|
edit => {
|
|
root.media-action("playlist", "", "edit");
|
|
}
|
|
media-action(kind, id, action) => {
|
|
root.media-action(kind, id, action);
|
|
}
|
|
}
|
|
if NavState.view == ContentView.settings: SettingsView {
|
|
settings-bool(k, v) => {
|
|
root.settings-bool(k, v);
|
|
}
|
|
settings-select(k, i) => {
|
|
root.settings-select(k, i);
|
|
}
|
|
settings-slider(k, v) => {
|
|
root.settings-slider(k, v);
|
|
}
|
|
settings-reset => {
|
|
root.settings-reset();
|
|
}
|
|
}
|
|
if NavState.view == ContentView.search: SearchResultsView {
|
|
open-album(id) => {
|
|
root.open-album(id);
|
|
}
|
|
open-artist(id) => {
|
|
root.open-artist(id);
|
|
}
|
|
media-action(kind, id, action) => {
|
|
root.media-action(kind, id, action);
|
|
}
|
|
}
|
|
}
|
|
|
|
// Right-side panels — layout siblings of the content area, so
|
|
// they shrink the content rather than overlaying it. Always
|
|
// present; each animates its own width open/closed.
|
|
QueueSidebar { }
|
|
LyricsSidebar { }
|
|
}
|
|
|
|
PlayerBar {
|
|
open-album(id) => {
|
|
root.open-album(id);
|
|
}
|
|
open-artist(id) => {
|
|
root.open-artist(id);
|
|
}
|
|
}
|
|
}
|
|
|
|
// Header nav-tab dropdown menus. Declared LAST so it draws on top of
|
|
// the header and the content region. A plain in-window overlay (not
|
|
// a PopupWindow) — it does not grab the pointer, so the header tabs
|
|
// stay hoverable and menus can be hover-switched instantly.
|
|
HeaderMenuOverlay {
|
|
navigate(route) => {
|
|
root.header-menu-navigate(route);
|
|
}
|
|
}
|
|
|
|
// Global "Add to playlist" picker overlay, opened from any track
|
|
// context menu.
|
|
PlaylistPickerModal { }
|
|
|
|
// Global "Create playlist" modal, opened from the sidebar "+".
|
|
CreatePlaylistModal { }
|
|
|
|
// Global "Edit playlist" modal (rename / delete).
|
|
EditPlaylistModal { }
|
|
|
|
// Global "Create folder" modal.
|
|
CreateFolderModal { }
|
|
|
|
// Global "Folder editor" modal (Playlist Manager create/edit folder).
|
|
FolderEditModal { }
|
|
|
|
// Floating track-drag ghost (follows the cursor, on top of all).
|
|
DragGhost { }
|
|
}
|