feat(kiosk): lightweight KioskAlbum + KioskArtist detail views

Replace the reused AlbumPageView/ArtistPageView on the kiosk album/artist
routes with Pi-light detail: KioskAlbum (cover + title + tappable artist +
Play/Shuffle + number/title/duration track list, reading AlbumState) and
KioskArtist (round portrait + Play/Radio + discography as KioskCard shelves
per release section, skipping the \"other\" bucket, reading ArtistState). Both
bind the shared state so covers push in. Validated via slintcheck.

cc
This commit is contained in:
vicrodh committed 2026-07-10 19:54:56 -06:00
1 parent 172dbf8eb6
commit ad9a23bab6
3 files changed
+294 -4

No files matched your search

+166
View File
@@ -0,0 +1,166 @@
// KioskAlbum — lightweight kiosk album detail (2.0.2 frente #3). Reads AlbumState
// (same as the desktop AlbumPageView): a header (big cover + title + artist +
// quality + Play/Shuffle) and a simple track list (number + title + duration).
// Album track rows carry no artwork, so we show the track number.
import { Theme } from "../foundation/semantic-colors.slint";
import { Radius } from "../foundation/radius.slint";
import { AlbumState, NowPlayingState } from "../state.slint";
component PillButton inherits Rectangle {
in property <string> label;
in property <bool> primary;
callback clicked;
width: 132px;
height: 44px;
border-radius: Radius.sm;
background: root.primary ? Theme.accent : (ta.has-hover ? Theme.alpha-8 : Theme.surface-elevated);
border-width: root.primary ? 0px : 1px;
border-color: Theme.border-subtle;
Text {
text: root.label;
color: root.primary ? Theme.accent-text : Theme.text-primary;
font-size: 15px;
font-weight: 600;
horizontal-alignment: center;
vertical-alignment: center;
}
ta := TouchArea {
clicked => {
root.clicked();
}
}
}
export component KioskAlbum inherits Rectangle {
callback open-artist(string);
callback media-action(string, string, string);
property <length> pad: 22px;
Flickable {
viewport-width: self.width;
viewport-height: page.preferred-height;
page := VerticalLayout {
padding: root.pad;
spacing: 22px;
// Header.
HorizontalLayout {
spacing: 22px;
Rectangle {
width: 180px;
height: 180px;
border-radius: Radius.md;
background: Theme.surface-elevated;
clip: true;
Image {
width: 100%;
height: 100%;
source: AlbumState.artwork;
image-fit: cover;
}
}
VerticalLayout {
alignment: center;
spacing: 10px;
Text {
text: AlbumState.title;
color: Theme.text-primary;
font-size: 25px;
font-weight: 700;
wrap: word-wrap;
}
artist-row := Rectangle {
height: 26px;
horizontal-stretch: 0;
HorizontalLayout {
alignment: start;
Text {
text: AlbumState.artist;
color: Theme.text-secondary;
font-size: 17px;
vertical-alignment: center;
}
}
art-ta := TouchArea {
clicked => {
root.open-artist(AlbumState.artist-id);
}
}
}
Text {
text: AlbumState.quality-detail;
color: Theme.text-muted;
font-size: 13px;
}
HorizontalLayout {
alignment: start;
spacing: 10px;
PillButton {
label: @tr("Play");
primary: true;
clicked => {
root.media-action("album", AlbumState.id, "play");
}
}
PillButton {
label: @tr("Shuffle");
clicked => {
root.media-action("album", AlbumState.id, "shuffle");
}
}
}
}
}
// Track list.
VerticalLayout {
spacing: 2px;
for track[i] in AlbumState.tracks: trow-rect := Rectangle {
height: 52px;
border-radius: Radius.sm;
property <bool> current: NowPlayingState.track-id == track.id;
background: trow.has-hover
? Theme.alpha-6
: self.current ? Theme.accent.with-alpha(0.10) : transparent;
HorizontalLayout {
padding-left: 12px;
padding-right: 12px;
spacing: 14px;
Text {
text: track.number;
width: 30px;
color: Theme.text-muted;
font-size: 14px;
vertical-alignment: center;
horizontal-alignment: right;
}
VerticalLayout {
horizontal-stretch: 1;
alignment: center;
Text {
text: track.title;
color: trow-rect.current ? Theme.accent : Theme.text-primary;
font-size: 15px;
overflow: elide;
wrap: no-wrap;
}
}
Text {
text: track.duration;
color: Theme.text-muted;
font-size: 13px;
vertical-alignment: center;
}
}
trow := TouchArea {
clicked => {
root.media-action("track", track.id, "play");
}
}
}
}
}
}
}
+124
View File
@@ -0,0 +1,124 @@
// KioskArtist — lightweight kiosk artist detail (2.0.2 frente #3). Reads
// ArtistState (same as the desktop ArtistPageView): a header (round portrait +
// name + Play/Radio) and the discography as simple KioskCard shelves per release
// section (the junk "other" bucket is skipped).
import { Theme } from "../foundation/semantic-colors.slint";
import { Radius } from "../foundation/radius.slint";
import { ArtistState } from "../state.slint";
import { KioskCard } from "KioskCard.slint";
export component KioskArtist inherits Rectangle {
callback open-album(string);
callback media-action(string, string, string);
property <length> pad: 22px;
Flickable {
viewport-width: self.width;
viewport-height: page.preferred-height;
page := VerticalLayout {
padding: root.pad;
spacing: 22px;
HorizontalLayout {
spacing: 22px;
Rectangle {
width: 140px;
height: 140px;
border-radius: 70px;
background: Theme.surface-elevated;
clip: true;
Image {
width: 100%;
height: 100%;
source: ArtistState.artwork;
image-fit: cover;
}
}
VerticalLayout {
alignment: center;
spacing: 12px;
Text {
text: ArtistState.name;
color: Theme.text-primary;
font-size: 25px;
font-weight: 700;
wrap: word-wrap;
}
HorizontalLayout {
alignment: start;
spacing: 10px;
Rectangle {
width: 150px;
height: 44px;
border-radius: Radius.sm;
background: playtop-ta.has-hover ? Theme.accent-hover : Theme.accent;
Text {
text: @tr("Play");
color: Theme.accent-text;
font-size: 15px;
font-weight: 600;
horizontal-alignment: center;
vertical-alignment: center;
}
playtop-ta := TouchArea {
clicked => {
root.media-action("artist", ArtistState.id, "play-top");
}
}
}
Rectangle {
width: 130px;
height: 44px;
border-radius: Radius.sm;
background: radio-ta.has-hover ? Theme.alpha-8 : Theme.surface-elevated;
border-width: 1px;
border-color: Theme.border-subtle;
Text {
text: @tr("Radio");
color: Theme.text-primary;
font-size: 15px;
font-weight: 600;
horizontal-alignment: center;
vertical-alignment: center;
}
radio-ta := TouchArea {
clicked => {
root.media-action("artist", ArtistState.id, "radio-qbz");
}
}
}
}
}
}
for section in ArtistState.release-sections: VerticalLayout {
if section.release-type != "other" && section.albums.length > 0: VerticalLayout {
spacing: 12px;
Text {
text: section.title;
color: Theme.text-primary;
font-size: 18px;
font-weight: 600;
}
Flickable {
height: 182px;
viewport-width: strip.preferred-width;
viewport-height: self.height;
strip := HorizontalLayout {
spacing: 14px;
alignment: start;
for album in section.albums: KioskCard {
album: album;
clicked(id) => {
root.open-album(id);
}
}
}
}
}
}
}
}
}
+4 -4
View File
@@ -25,9 +25,9 @@ import { NavRail } from "NavRail.slint";
import { KioskDiscover } from "KioskDiscover.slint";
import { DiscoverBrowseView } from "../discover/DiscoverBrowseView.slint";
import { RecentAlbumsView } from "../discover/RecentAlbumsView.slint";
import { AlbumPageView } from "../album/AlbumPageView.slint";
import { KioskAlbum } from "KioskAlbum.slint";
import { LocalAlbumView } from "../album/LocalAlbumView.slint";
import { ArtistPageView } from "../artist/ArtistPageView.slint";
import { KioskArtist } from "KioskArtist.slint";
import { ArtistReleasesView } from "../artist/ArtistReleasesView.slint";
import { MusicianPageView } from "../musician/MusicianPageView.slint";
import { LabelReleasesView } from "../label/LabelReleasesView.slint";
@@ -217,7 +217,7 @@ export component KioskShell inherits Rectangle {
root.media-action(kind, id, action);
}
}
if NavState.view == ContentView.album && !OfflineState.offline: AlbumPageView {
if NavState.view == ContentView.album && !OfflineState.offline: KioskAlbum {
open-artist(id) => {
root.open-artist(id);
}
@@ -230,7 +230,7 @@ export component KioskShell inherits Rectangle {
root.open-artist(name);
}
}
if NavState.view == ContentView.artist && !OfflineState.offline: ArtistPageView {
if NavState.view == ContentView.artist && !OfflineState.offline: KioskArtist {
open-album(id) => {
root.open-album(id);
}