From 17a5003e4b00769c261b31b310d33ddfe0411cc5 Mon Sep 17 00:00:00 2001 From: NagyVikt Date: Sat, 16 May 2026 11:40:06 +0200 Subject: [PATCH] refactor(fleet-ui): split tab_strip into mod folder with render_pill helper Splits the 439-line tab_strip.rs into a tab_strip/ module folder so the single pill loop can call a dedicated render_pill helper instead of inlining 30+ lines of span construction and hit-test bookkeeping per iteration. Public API (TabStrip, Tab, TabHit, COUNTERS_PATH) is unchanged, all 6 existing tests still pass, and rendering output is identical. - tab_strip/mod.rs: public types + render orchestrator - tab_strip/layout.rs: CounterSnapshot, build_pills, natural width, format_clock, format_pill_label, render_counter - tab_strip/render.rs: paint_background, paint_logo_chip, paint_live_chip, render_pill --- rust/fleet-ui/src/tab_strip.rs | 439 -------------------------- rust/fleet-ui/src/tab_strip/layout.rs | 119 +++++++ rust/fleet-ui/src/tab_strip/mod.rs | 251 +++++++++++++++ rust/fleet-ui/src/tab_strip/render.rs | 103 ++++++ 4 files changed, 473 insertions(+), 439 deletions(-) delete mode 100644 rust/fleet-ui/src/tab_strip.rs create mode 100644 rust/fleet-ui/src/tab_strip/layout.rs create mode 100644 rust/fleet-ui/src/tab_strip/mod.rs create mode 100644 rust/fleet-ui/src/tab_strip/render.rs diff --git a/rust/fleet-ui/src/tab_strip.rs b/rust/fleet-ui/src/tab_strip.rs deleted file mode 100644 index 663e612..0000000 --- a/rust/fleet-ui/src/tab_strip.rs +++ /dev/null @@ -1,439 +0,0 @@ -//! Glass-dock in-binary tab strip — the top-of-frame pill row each codex-fleet -//! bin renders to match the new tmux-level tab strip. -//! -//! Anatomy (single row, height = 1): -//! -//! ```text -//! [◆ codex-fleet HH:MM:SS] ( 0 ⊙ Overview 7 ) [ 1 ⊙ Fleet 12 ] [ 2 ⊙ Plan 3 ] [ 3 ⊙ Waves 1 ] [ 4 ⊙ Review – ] [● live · 1234] -//! └─ logo chip ──────────┘ └─ active pill ──┘ └─ inactive pills ────────────────────────────────────────────┘ └─ live chip ─┘ -//! ``` -//! -//! - **Logo chip** (left): `◆ codex-fleet` + a muted `HH:MM:SS` from -//! `std::time::SystemTime::now()` (no `chrono` in workspace; we format the -//! local wall clock by hand). -//! - **Tabs** (centre): fixed 5-tab order `Overview / Fleet / Plan / Waves / -//! Review`. Each pill carries `