Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions rust/fleet-data/src/fleet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,23 @@ impl WorkerRow {
pub fn is_in_review(&self) -> bool {
matches!(self.state, Some(PaneState::Approval))
}

/// `true` when this row counts toward the "capped" tally on dashboards.
///
/// Two independent signals can flip a row to capped:
///
/// 1. `agent-auth list` reports `5h >= 100%` — the cap-pool number has
/// already crossed the throttle line even before the pane noticed.
/// 2. The pane's scrollback classifier returned [`PaneState::Capped`] —
/// the pane itself printed a 5-hour quota message.
///
/// The OR keeps either signal alone enough to count the row, which is the
/// rule the per-binary `ios_page_design.rs` modules used to recompute
/// inline. Lifting it here keeps every dashboard's "capped" number agreeing
/// with the data layer instead of drifting per renderer.
pub fn is_capped(&self) -> bool {
self.five_h_pct >= 100 || matches!(self.state, Some(PaneState::Capped))
}
}

/// Header summary line: "8 workers · 6 live · 1 in review".
Expand Down
12 changes: 0 additions & 12 deletions rust/fleet-renderer-polish/Cargo.toml

This file was deleted.

154 changes: 0 additions & 154 deletions rust/fleet-renderer-polish/src/lib.rs

This file was deleted.

5 changes: 1 addition & 4 deletions rust/fleet-state/src/ios_page_design.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,7 @@ impl Summary {
Self {
accounts: rows.len(),
live: rows.iter().filter(|row| row.is_live()).count(),
capped: rows
.iter()
.filter(|row| row.five_h_pct >= 100 || matches!(row.state, Some(PaneState::Capped)))
.count(),
capped: rows.iter().filter(|row| row.is_capped()).count(),
review: rows
.iter()
.filter(|row| matches!(row.state, Some(PaneState::Approval)))
Expand Down
53 changes: 53 additions & 0 deletions rust/fleet-ui/src/palette.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,58 @@ mod tests {
Color::Rgb(0x26, 0x26, 0x28),
"IOS_ROW_BG_DARK must be #262628"
);
// Extended coverage: every constant that per-binary `ios_page_design.rs`
// modules import via `palette::*`. If any drifts the migration loses
// its canonical anchor.
assert_eq!(
IOS_FG_MUTED,
Color::Rgb(0xa0, 0xa0, 0xaa),
"IOS_FG_MUTED must be #a0a0aa"
);
assert_eq!(
IOS_FG_FAINT,
Color::Rgb(0x6e, 0x6e, 0x78),
"IOS_FG_FAINT must be #6e6e78"
);
assert_eq!(
IOS_BG_GLASS,
Color::Rgb(0x26, 0x26, 0x28),
"IOS_BG_GLASS must be #262628"
);
assert_eq!(
IOS_HAIRLINE,
Color::Rgb(0x3c, 0x3c, 0x41),
"IOS_HAIRLINE must be #3c3c41"
);
assert_eq!(
IOS_HAIRLINE_STRONG,
Color::Rgb(0x55, 0x55, 0x5a),
"IOS_HAIRLINE_STRONG must be #55555a"
);
assert_eq!(
IOS_CHIP_BG,
Color::Rgb(0x36, 0x36, 0x3a),
"IOS_CHIP_BG must be #36363a"
);
assert_eq!(
IOS_CARD_BG,
Color::Rgb(0x2c, 0x2c, 0x30),
"IOS_CARD_BG must be #2c2c30"
);
assert_eq!(
IOS_ICON_CHIP,
Color::Rgb(0x46, 0x46, 0x4c),
"IOS_ICON_CHIP must be #46464c"
);
assert_eq!(
IOS_TINT_DARK,
Color::Rgb(0x07, 0x64, 0xdc),
"IOS_TINT_DARK must be #0764dc"
);
assert_eq!(
IOS_TINT_SUB,
Color::Rgb(0xd2, 0xe0, 0xff),
"IOS_TINT_SUB must be #d2e0ff"
);
}
}
14 changes: 9 additions & 5 deletions rust/fleet-watcher/src/ios_page_design.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
use fleet_ui::palette::{
IOS_DESTRUCTIVE as IOS_RED, IOS_GREEN, IOS_ORANGE, IOS_TINT as IOS_BLUE,
};
use ratatui::{
buffer::Buffer,
layout::{Constraint, Direction, Layout, Margin, Rect},
Expand All @@ -6,6 +9,10 @@ use ratatui::{
widgets::{Block, BorderType, Borders, Paragraph, Widget, Wrap},
};

// Local surface tones — this mock dashboard runs on a deeper-than-`IOS_BG_SOLID`
// dark surface and keeps its own greyscale ramp so the panels read as a
// separate visual context from the production fleet board. Only the iOS-named
// accent colors above ride the canonical `fleet-ui::palette` values.
const BG: Color = Color::Rgb(0x10, 0x12, 0x16);
const SURFACE: Color = Color::Rgb(0x1a, 0x1d, 0x24);
const SURFACE_ALT: Color = Color::Rgb(0x20, 0x24, 0x2d);
Expand All @@ -15,11 +22,8 @@ const TEXT: Color = Color::Rgb(0xf3, 0xf5, 0xf8);
const MUTED: Color = Color::Rgb(0xa7, 0xae, 0xbb);
const FAINT: Color = Color::Rgb(0x78, 0x80, 0x8e);

const IOS_BLUE: Color = Color::Rgb(0x00, 0x7a, 0xff);
const IOS_GREEN: Color = Color::Rgb(0x34, 0xc7, 0x59);
const IOS_RED: Color = Color::Rgb(0xff, 0x3b, 0x30);
const IOS_ORANGE: Color = Color::Rgb(0xff, 0x95, 0x00);

// Tinted soft-fill washes derived from the accent colors — kept local because
// they are intentionally dark muted bg tints not present in the canonical palette.
const BLUE_SOFT: Color = Color::Rgb(0x0f, 0x24, 0x42);
const ORANGE_SOFT: Color = Color::Rgb(0x35, 0x27, 0x11);
const RED_SOFT: Color = Color::Rgb(0x37, 0x16, 0x14);
Expand Down
11 changes: 6 additions & 5 deletions rust/fleet-waves/src/ios_page_design.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
use fleet_ui::palette::{
IOS_DESTRUCTIVE as DANGER, IOS_GREEN as SUCCESS, IOS_ORANGE as WARNING, IOS_TINT as ACCENT,
};
use ratatui::{
buffer::Buffer,
layout::{Constraint, Direction, Layout, Margin, Rect},
Expand All @@ -6,6 +9,9 @@ use ratatui::{
widgets::{Block, BorderType, Borders, Paragraph, Widget},
};

// Local surface tones — the wave timeline runs on its own deeper-than-
// `IOS_BG_SOLID` ramp so the timeline panel reads as a distinct context.
// Only the iOS-named accent colors above ride canonical `fleet-ui::palette`.
const BG: Color = Color::Rgb(14, 17, 24);
const SURFACE: Color = Color::Rgb(22, 26, 36);
const SURFACE_ELEVATED: Color = Color::Rgb(30, 35, 47);
Expand All @@ -16,11 +22,6 @@ const MUTED: Color = Color::Rgb(163, 171, 188);
const FAINT: Color = Color::Rgb(102, 111, 130);
const DARK_TEXT: Color = Color::Rgb(13, 15, 20);

const ACCENT: Color = Color::Rgb(0, 122, 255);
const SUCCESS: Color = Color::Rgb(52, 199, 89);
const DANGER: Color = Color::Rgb(255, 59, 48);
const WARNING: Color = Color::Rgb(255, 149, 0);

const CHIP_LABEL_WIDTH: u16 = 7;
const CHIP_WIDTH: u16 = 13;

Expand Down