Tell why the home has no cards yet and tidy the cards code after review (#72)

Without statistics the home said « Aucun champion trouvé » under a count of
0; it now shows the same notice as the champ select (loading, no Account),
from a small StatsNotice enum instead of compared strings.

Also from the review: a structural test that hovering or scrolling
« Autres champions » recomputes no statistics, as docs/performance.md says;
English comments; one card aspect (core's CARD_ASPECT) and one cards_dir;
one builder for the champ select cards, one count badge, one test temp dir;
clearer names (with_cards_behaviour, home_has_own_scope).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
nessarandClaude Opus 5.5 committed 2026-11-21 02:26:14 +01:00
1 parent 213d693ab8
commit 72f7a239c0
8 files changed
+303 -106

No files matched your search

+8 -3
View File
@@ -322,7 +322,12 @@ impl CardGrid {
impl CardGrid {
/// The grid's key context, its portraits and what it reacts to besides its cards.
fn wired(&self, root: Div, images: Entity<CardImages>, cx: &mut Context<Self>) -> Div {
fn with_cards_behaviour(
&self,
root: Div,
images: Entity<CardImages>,
cx: &mut Context<Self>,
) -> Div {
card_images::provide(root, images)
.key_context(CONTEXT)
// A wheel scroll moves cards under a still pointer without a hover event: the
@@ -370,11 +375,11 @@ impl Render for CardGrid {
.map(|ix| self.row(ix, metrics, window, cx))
.collect();
return self
.wired(div().v_flex().w_full(), images, cx)
.with_cards_behaviour(div().v_flex().w_full(), images, cx)
.children(rows)
.into_any_element();
}
self.wired(div().relative().size_full(), images, cx)
self.with_cards_behaviour(div().relative().size_full(), images, cx)
.debug_selector(|| "card-list".into())
.child(
uniform_list(