git.lucas.co / cce-system-interface
system settings
git clone https://git.lucas.co/cce-system-interface.git

commitc26706ebf3d897e0b6bd5f9d63b4653581217687
parentbab0f0fd06
authorLucas Galante <[email protected]>
date2026-08-22 12:39
chore: three leftovers from the dispatch-root audit

None of these were reachable bugs; they were the loose ends the audit
turned up while checking the pages that did have them.

system_info declared with_section_count(8) against seven add_section
calls and seven section_widgets groups. A subagent flagged this as
critical ctrl-nav breakage, which it is not — the value only caps the
grid's column count (`n.min(cols)` in cce-ui's AdaptiveGrid), so below
eight columns the stale 8 and a correct 7 compute the same layout. Fixed
because it reads as a section that isn't there, not because it misbehaved.
Verified in the shadow: all seven sections still render, two columns,
zero unregistered-root drops.

audio's view test passed a two-element sec_focused to a page whose
section_widgets returns exactly one group. Harmless — every page reads
the slice through .get(n).unwrap_or(false) — but it implies a second
section that has never existed.

power carried an unused RenderTarget import since the page landed; the
crate now builds without warnings.

Co-Authored-By: Claude <[email protected]>

 src/pages/audio.rs       | 4 +++-
 src/pages/power.rs       | 2 +-
 src/pages/system_info.rs | 6 +++++-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/pages/audio.rs b/src/pages/audio.rs
index 4985cd5..52c3f21 100644
--- a/src/pages/audio.rs
+++ b/src/pages/audio.rs
@@ -504,7 +504,9 @@ mod tests {
             source_sliders: vec![],
         };
         let mut layout = AdaptiveGrid::new(260.0, 20.0);
-        let pc = view(&mut state, 10.0, 20.0, 800.0, 600.0, &[false, false], &mut layout, &mut cce_ui::context::UiContext::new());
+        // One flag: section_widgets() returns a single group (the output ids
+        // with input appended), so the view draws one section and reads [0].
+        let pc = view(&mut state, 10.0, 20.0, 800.0, 600.0, &[false], &mut layout, &mut cce_ui::context::UiContext::new());
         for (i, (c, x, y, w, h, r, _)) in pc.rects.iter().enumerate() {
             println!("TEST_PC_RECT {}: color={:?}, x={}, y={}, w={}, h={}, r={}", i, c, x, y, w, h, r);
         }
diff --git a/src/pages/power.rs b/src/pages/power.rs
index 76b1ee3..c5c6b89 100644
--- a/src/pages/power.rs
+++ b/src/pages/power.rs
@@ -14,7 +14,7 @@
 //! auth prompt reverts the dropdown — honest, with no extra error channel.
 
 use crate::app::{AppAction, PageContent};
-use cce_ui::layout::{PageLayoutBuilder, LayoutStrategy, RenderTarget};
+use cce_ui::layout::{PageLayoutBuilder, LayoutStrategy};
 use cce_ui::widget::{Dropdown, WidgetHost};
 
 const TEXT_FG: [f32; 4] = [0.83, 0.83, 0.83, 1.0];
diff --git a/src/pages/system_info.rs b/src/pages/system_info.rs
index d29d545..a81dde0 100644
--- a/src/pages/system_info.rs
+++ b/src/pages/system_info.rs
@@ -486,7 +486,11 @@ const WHITE: [f32; 4] = [1.0, 1.0, 1.0, 1.0];
 pub fn view(state: &mut SystemState, cx: f32, cy: f32, cw: f32, ch: f32, _root_focused: bool, sec_focused: &[bool], layout: &mut dyn LayoutStrategy, ctx: &mut cce_ui::context::UiContext) -> PageContent {
     let mut final_pc = PageContent::new();
     let sec_w = 320.0f32;
-    let mut builder = PageLayoutBuilder::new(layout, cx, cy, cw, ch, sec_w).with_section_count(8);
+    // Seven, matching the add_section calls below and the seven groups
+    // section_widgets reports. The count caps the grid's column count
+    // (`n.min(cols)`), so the stale 8 only bit once the window was wide enough
+    // for eight columns — harmless, but it read as a missing eighth section.
+    let mut builder = PageLayoutBuilder::new(layout, cx, cy, cw, ch, sec_w).with_section_count(7);
 
     // ── 1. System Section ──
     builder.add_section(&mut final_pc, "System", sec_focused.first().copied().unwrap_or(false), |sec| {