From e42c3909fa13735740e904836ec00102ad88255d Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Fri, 20 Nov 2026 22:17:20 -0700 Subject: [PATCH] fix(gui): the tab strip's width is folded, not summed, so kernel-only passes scripts/raw-decimal-arith.sh refuses an Iterator::sum of any type (it cannot tell widths from money without types it does not have). The tab widths are f32 layout, no money; a fold says the same and the check reads 0 places. Co-Authored-By: Claude Sonnet 5.5 --- crates/ledger-gui/src/tabs.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/ledger-gui/src/tabs.rs b/crates/ledger-gui/src/tabs.rs index a3b2ce4c..1f56dbae 100644 --- a/crates/ledger-gui/src/tabs.rs +++ b/crates/ledger-gui/src/tabs.rs @@ -176,8 +176,10 @@ impl TabBar { // when they don't fit, the "+" stays at the right edge // and the tabs scroll. let widths: Vec = tabs.iter().map(|t| tab_width(ui, t)).collect(); - let total: f32 = - widths.iter().sum::() + widths.len().saturating_sub(1) as f32 * TAB_GAP; + // A fold, not `sum`: the kernel-only check refuses an + // `Iterator::sum` of any type, and these are widths. + let total: f32 = widths.iter().fold(0.0, |w, t| w + t) + + widths.len().saturating_sub(1) as f32 * TAB_GAP; let room = (ui.available_width() - PLUS_W - PLUS_GAP).max(0.0); let strip_w = total.min(room); let strip = egui::Rect::from_min_size(bar.min, vec2(strip_w, bar.height()));