From b438bb234908bd64b5ed3da0da3694be1fc614d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Sat, 9 May 2026 20:16:30 -0400 Subject: [PATCH] Use real reading-list count on the home cover badge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The reading-list cover badge previously read "Reading List · 1" when a featured entry existed and "Reading List · 0" otherwise — a binary flag stamped onto a count format. The user's actual reading list can hold many entries, and the design clearly intends the badge to show the total ("Reading List · 5" in the mock). Pass snapshot.reading_list.len() through render_reading_list_cover so the badge mirrors the real count. --- crates/ely_app/src/shell/chrome/home/recap.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/ely_app/src/shell/chrome/home/recap.rs b/crates/ely_app/src/shell/chrome/home/recap.rs index a50fcac..48131b3 100644 --- a/crates/ely_app/src/shell/chrome/home/recap.rs +++ b/crates/ely_app/src/shell/chrome/home/recap.rs @@ -49,6 +49,7 @@ fn render_continue_card( ) -> AnyElement { let recent_history: Vec<&HistoryEntry> = snapshot.history_entries.iter().rev().take(3).collect(); let featured = snapshot.reading_list.first(); + let reading_total = snapshot.reading_list.len(); div() .rounded(px(16.0)) @@ -67,7 +68,7 @@ fn render_continue_card( div() .w(px(240.0)) .flex_shrink_0() - .child(render_reading_list_cover(featured, cx)), + .child(render_reading_list_cover(featured, reading_total, cx)), ) .into_any_element() } @@ -167,6 +168,7 @@ fn render_history_row( fn render_reading_list_cover( featured: Option<&ReadingListEntry>, + reading_total: usize, cx: &mut Context, ) -> AnyElement { let title = featured @@ -234,7 +236,7 @@ fn render_reading_list_cover( .bg(rgba(BADGE_BG)) .text_size(px(10.5)) .text_color(rgb(0xffffff)) - .child(format!("Reading List · {}", featured.map(|_| 1).unwrap_or(0))), + .child(format!("Reading List · {}", reading_total)), ) .child( div()