polish(engine): standard empty/loading/error states (Phase L)
New ui_modal::spawn_empty_state — glyph + headline + optional detail, centred, with next-step actions composed alongside rather than configured in. Glyphs restricted to FiraMono-covered ranges (suits, arrows, ASCII) per the section-10/11 Android constraint. Swept every improvised surface onto it: - Theme store: loading / error / empty-catalog branches - Leaderboard: fetching / error / be-the-first branches - You-hub Replays tab: dedicated no-replays state (selector and actions no longer spawn dead controls when history is empty) - Stats: first-launch nudge above the em-dash grid The Account tab's sync row was deliberately NOT swept: it is a live status + action row, not an empty state, and its deeper treatment belongs to Phase M's sync-transparency work. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -32,8 +32,8 @@ use crate::resources::TokioRuntimeResource;
|
||||
use crate::settings_plugin::{SettingsPanel, SettingsResource};
|
||||
use crate::theme::{ImportError, ThemeRegistry, import_theme, refresh_registry};
|
||||
use crate::ui_modal::{
|
||||
ButtonVariant, ModalScrim, ScrimDismissible, spawn_modal, spawn_modal_actions,
|
||||
spawn_modal_button, spawn_modal_header,
|
||||
ButtonVariant, ModalScrim, ScrimDismissible, spawn_empty_state, spawn_modal,
|
||||
spawn_modal_actions, spawn_modal_button, spawn_modal_header,
|
||||
};
|
||||
use crate::ui_theme::{
|
||||
BORDER_SUBTLE, TEXT_PRIMARY, TEXT_SECONDARY, TYPE_BODY, TYPE_CAPTION, VAL_SPACE_2, VAL_SPACE_3,
|
||||
@@ -528,25 +528,31 @@ fn spawn_store_modal(
|
||||
|
||||
match catalog_state {
|
||||
CatalogState::Idle | CatalogState::Loading => {
|
||||
card.spawn((
|
||||
Text::new("Loading catalog…"),
|
||||
body_font.clone(),
|
||||
TextColor(TEXT_SECONDARY),
|
||||
));
|
||||
spawn_empty_state(
|
||||
card,
|
||||
"\u{21BB}",
|
||||
"Loading the catalog\u{2026}",
|
||||
None,
|
||||
font_res,
|
||||
);
|
||||
}
|
||||
CatalogState::Error(msg) => {
|
||||
card.spawn((
|
||||
Text::new(format!("Could not load the catalog: {msg}")),
|
||||
body_font.clone(),
|
||||
TextColor(TEXT_SECONDARY),
|
||||
));
|
||||
spawn_empty_state(
|
||||
card,
|
||||
"!",
|
||||
"Couldn't load the catalog.",
|
||||
Some(msg.as_str()),
|
||||
font_res,
|
||||
);
|
||||
}
|
||||
CatalogState::Loaded(entries) if entries.is_empty() => {
|
||||
card.spawn((
|
||||
Text::new("The server has no themes yet."),
|
||||
body_font.clone(),
|
||||
TextColor(TEXT_SECONDARY),
|
||||
));
|
||||
spawn_empty_state(
|
||||
card,
|
||||
"#",
|
||||
"The server has no themes yet.",
|
||||
Some("Themes dropped into the server's theme_store folder appear here."),
|
||||
font_res,
|
||||
);
|
||||
}
|
||||
CatalogState::Loaded(entries) => {
|
||||
for entry in entries {
|
||||
|
||||
Reference in New Issue
Block a user