refactor(fleet): consolidate palette + is_live, drop renderer-polish#166
Merged
Merged
Conversation
Operator review flagged three drift sources where per-binary code disagreed with the canonical fleet-ui/data layer. This compound PR unifies all three on the shared crates and deletes a stranded library. (a) Palette migration - Per-binary `ios_page_design.rs` modules in fleet-watcher and fleet-waves declared their own `IOS_BLUE/GREEN/RED/ORANGE` (watcher) and `ACCENT/SUCCESS/DANGER/WARNING` (waves) constants using iOS *Light* system values (#007aff, #34c759, #ff3b30, #ff9500). - These dashboards render on a dark TUI surface, so iOS Dark variants are correct. `fleet-ui::palette` already exposed the canonical Dark-mode constants (#0a84ff, #30d158, #ff453a, #ff9f0a). Each binary now `use`s the palette names and aliases them in-place. - Local surface tones (BG / SURFACE / TEXT / *_SOFT) stay in each binary because the mock pages intentionally use a deeper dark surface than the production board. - Extended the `palette_hex_parity` test to lock in every constant the per-binary modules now import via `palette::*` so future drift fails the test rather than the dashboard. (b) Renderer-polish deletion - `rust/fleet-renderer-polish/` was library-only, unadopted, and declared a third copy of the same iOS-named colors (drift source). - `git rm -r`d the whole crate; no workspace crate depended on it (verified via grep). The `fleet-*` glob in workspace `Cargo.toml` drops it automatically. (c) is_live / is_capped unification - `WorkerRow::is_live` was already on the data layer, but `fleet-state/src/ios_page_design.rs::Summary::from_rows` recomputed "capped" inline as `row.five_h_pct >= 100 || matches!(row.state, Some(PaneState::Capped))`. Any other dashboard that wanted the same tally would have re-derived this rule. - Lifted that predicate to `WorkerRow::is_capped(&self) -> bool` with a docstring spelling out the two-signal contract (cap-pool % crossing the line OR pane classifier returning Capped). Migrated fleet-state's Summary to call `row.is_capped()`. Verification - `cargo check --workspace` clean. - `cargo test --workspace --exclude fleet-ui` all green; `cargo test -p fleet-ui --lib` all green (palette hex-parity guard included). - fleet-ui has a pre-existing test-only compile error in `tests/tab_strip_snapshot.rs` referencing the removed `fleet_ui::tab_strip` module (from PR #156's mod-folder split) — untouched by this PR. - TestBackend snapshot output is text-only, so accent-color migration does not affect any snapshot fixture.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Operator review flagged three drift sources where per-binary code disagreed with the canonical
fleet-ui/fleet-datalayer. Compound PR because all three patches touch the same per-binaryios_page_design.rsfiles.fleet-watcherandfleet-waveswere declaring their own iOS-named accent constants. Migrated them tofleet_ui::palette::*and locked the canonical hexes with hex-parity tests.rust/fleet-renderer-polish/was library-only, unadopted, and a third copy of those same colors (drift source). Deleted entirely.WorkerRow::is_capped()tofleet-dataso dashboards can't disagree with the data layer on the "capped" tally.Drift resolution table
The two per-binary modules used iOS Light-mode system colors; the dashboards render on a dark TUI surface so the palette's iOS Dark-mode variants are correct. Palette wins every contest.
palette::*(hex)fleet-watcherIOS_BLUE#007affIOS_TINT#0a84ff.systemBlue(Dark)fleet-watcherIOS_GREEN#34c759IOS_GREEN#30d158.systemGreen(Dark)fleet-watcherIOS_RED#ff3b30IOS_DESTRUCTIVE#ff453a.systemRed(Dark)fleet-watcherIOS_ORANGE#ff9500IOS_ORANGE#ff9f0a.systemOrange(Dark)fleet-wavesACCENT#007affIOS_TINT#0a84ff.systemBlue(Dark)fleet-wavesSUCCESS#34c759IOS_GREEN#30d158.systemGreen(Dark)fleet-wavesDANGER#ff3b30IOS_DESTRUCTIVE#ff453a.systemRed(Dark)fleet-wavesWARNING#ff9500IOS_ORANGE#ff9f0a.systemOrange(Dark)Each binary keeps its local surface tones (
BG,SURFACE,*_SOFT, etc.) because the mock pages intentionally use a deeper-than-IOS_BG_SOLIDramp to read as distinct visual contexts; only the iOS-named accent palette was drifting.is_cappedcontractMigrated
fleet-state::Summary::from_rowsto callrow.is_capped()instead of recomputing inline.is_livealready lived onWorkerRow; this just adds the partner predicate so dashboards can't disagree.Files deleted
rust/fleet-renderer-polish/Cargo.tomlrust/fleet-renderer-polish/src/lib.rsThe workspace
fleet-*glob inrust/Cargo.tomldrops it automatically — no manifest edit needed. Verified no other workspace crate referencedfleet-renderer-polish/fleet_renderer_polishbefore deletion.Per-binary line-count delta
Modest because most lines came from local surface tones (kept) and the new code is mostly hex-parity tests + the
is_cappeddocstring:Plus -155 from
fleet-renderer-polishremoval.Test plan
cargo check --workspacecleancargo test -p fleet-ui --lib— 39 tests pass, palette hex-parity guard (extended) greencargo test --workspace --exclude fleet-ui— all green; fleet-state, fleet-waves, fleet-watcher snapshot tests pass unchanged (TestBackend output is text-only so accent migration does not perturb fixtures)#0a84ff / #30d158 / #ff453a / #ff9f0ainstead of#007aff / #34c759 / #ff3b30 / #ff9500. Visually this is a slight shift toward the brighter Dark-mode iOS palette already used byfleet-stateand the rest of the dashboard. Worth confirming on the live boards.Notes
rust/fleet-ui/tests/tab_strip_snapshot.rsreferences the removedfleet_ui::tab_stripmodule path (left over from PR refactor(fleet-ui): split tab_strip into mod/layout/render and extract render_pill #156's mod-folder split). Untouched by this PR; surfaces only withcargo test -p fleet-uiincluding integration tests.