After sign-in the app loads the real Qobuz discover index and renders the Home view: a time-based greeting with the user's name, the tab pill (Home / Editor's Picks / For You), and discover sections — New Releases, Press Accolades, Ideal Discography, Qobuzissimes, Albums of the Week — each a horizontally scrolling row of album cards. - state.slint: AlbumCardItem / DiscoverSection structs, HomeState global. - discover/: AlbumCard (artwork area, award ribbon, title, artist, quality badge), SectionRow, HomeView. - home.rs: discover-index fetch and mapping (award-ribbon priority, quality string), greeting, and event-loop model application. Unit tests for ribbon, quality, and greeting logic. - AppShell content region is now the HomeView. Album artwork images load in the next increment (artwork pipeline); cards currently show the elevated placeholder. No fixtures — all data is the live discover index. cc
52 lines
1.5 KiB
Plaintext
52 lines
1.5 KiB
Plaintext
// QBZ Slint POC — UI entry point.
|
|
//
|
|
// Stays thin: imports the feature screens and exports the single
|
|
// top-level window. No raw visual constants or domain logic here
|
|
// (POC ADR, sections 13 and 21).
|
|
|
|
import { Theme } from "foundation/semantic-colors.slint";
|
|
import { LoginScreen } from "login/LoginScreen.slint";
|
|
import { AppShell } from "shell/AppShell.slint";
|
|
|
|
// Re-export the HomeState global so the Rust layer can populate it.
|
|
export { HomeState } from "state.slint";
|
|
|
|
// Which top-level screen is shown. During M1 the screen switches on a
|
|
// login-button click without real authentication; M2 ties the switch
|
|
// to a real session.
|
|
export enum AppScreen { login, shell }
|
|
|
|
export component AppWindow inherits Window {
|
|
title: "QBZ";
|
|
preferred-width: 1180px;
|
|
preferred-height: 760px;
|
|
min-width: 940px;
|
|
min-height: 600px;
|
|
background: Theme.surface-main;
|
|
|
|
in-out property <AppScreen> screen: AppScreen.login;
|
|
|
|
// Forwarded to the Rust layer, which maps them to typed AppCommands.
|
|
callback sign-in-via-browser();
|
|
callback use-system-browser();
|
|
callback start-offline();
|
|
callback open-tos();
|
|
|
|
if root.screen == AppScreen.login: LoginScreen {
|
|
sign-in-via-browser => {
|
|
root.sign-in-via-browser();
|
|
}
|
|
use-system-browser => {
|
|
root.use-system-browser();
|
|
}
|
|
start-offline => {
|
|
root.start-offline();
|
|
}
|
|
open-tos => {
|
|
root.open-tos();
|
|
}
|
|
}
|
|
|
|
if root.screen == AppScreen.shell: AppShell { }
|
|
}
|