use crate::ui::Model;
use super::super::{own, seated};
pub(crate) fn figure(usd: Option<&str>, label: Option<&str>) -> crate::reply::spend::Figure {
crate::reply::spend::Figure {
tokens: crate::reply::steps::Spend {
input: 11,
output: 22,
cache_read: 33,
cache_write: 44,
total: 99,
},
usd: usd.map(str::to_owned),
attribution: crate::reply::spend::Attribution {
kind: "conversations".to_owned(),
label: label.map(str::to_owned),
},
}
}
pub(crate) fn column(id: &str, column: &str) -> crate::reply::board::BoardRow {
crate::reply::board::BoardRow {
id: id.to_owned(),
column: column.to_owned(),
state: "ready".to_owned(),
title: format!("what {id} is for"),
priority: 2,
project: "lernie".to_owned(),
workspace: None,
claimant: None,
parent: None,
gates: Vec::new(),
drones: Vec::new(),
spend: None,
rollup: None,
}
}
pub(crate) fn filing() -> Model {
let mut model = boarded();
model.begin_filing();
if let Some(block) = model.authoring.as_mut() {
block.project = "lernie".to_owned();
block.title = "the ball this would file".to_owned();
}
model
}
pub(crate) fn amending() -> Model {
let mut model = boarded();
model.begin_amending(&bound("bl-1"));
if let Some(block) = model.authoring.as_mut() {
block.note = "what happened".to_owned();
block.arm = "bl-1".to_owned();
}
model
}
pub(crate) fn bound(id: &str) -> crate::reply::balls::BoundBall {
crate::reply::balls::BoundBall {
id: id.to_owned(),
badge: Some("delivered".to_owned()),
project: "lernie".to_owned(),
owner: "alba".to_owned(),
state: "bound".to_owned(),
spend: figure(Some("$2.50"), None),
}
}
pub(crate) fn boarded() -> Model {
let claimed = crate::reply::board::BoardRow {
state: "bound".to_owned(),
workspace: Some("home".to_owned()),
claimant: Some("alba".to_owned()),
parent: Some("bl-epic".to_owned()),
drones: vec![crate::reply::board::Drone {
root_id: "20260830T051200Z-a1b2".to_owned(),
name: "Cobalt".to_owned(),
}],
spend: Some(figure(Some("$1.50"), Some("over 2 conversations"))),
rollup: Some(figure(None, None)),
..column("bl-1", "claimed")
};
let gated = crate::reply::board::BoardRow {
gates: vec![crate::reply::board::Gate {
id: "bl-gate".to_owned(),
title: "the gate".to_owned(),
mints: "close".to_owned(),
}],
..column("bl-2", "gated")
};
Model {
lookup: Some(crate::ui::Lookup::Board),
columns: vec![crate::ui::Columns {
channel: own().channel,
board: crate::reply::board::Board {
rows: vec![claimed, gated, column("bl-3", "ready")],
fleet: vec![crate::reply::board::Fleet {
workspace: "home".to_owned(),
project: "lernie".to_owned(),
cap: 4,
count: 4,
room: false,
ceiling: Some("over budget".to_owned()),
label: "4/4 drones · tick 1m · last 30s ago".to_owned(),
}],
},
}],
bindings: vec![crate::ui::Bindings {
channel: own().channel,
rows: vec![
crate::reply::balls::BallRow {
ball_id: "bl-1".to_owned(),
project: "lernie".to_owned(),
state: "bound".to_owned(),
title: Some("what bl-1 is for".to_owned()),
claimant: Some("alba".to_owned()),
workspace: Some("home".to_owned()),
},
crate::reply::balls::BallRow {
ball_id: "bl-3".to_owned(),
project: "lernie".to_owned(),
state: "ready".to_owned(),
title: None,
claimant: None,
workspace: None,
},
],
}],
holding: Some(vec![bound("bl-1")]),
marks: Some("balls/tasks".to_owned()),
..seated()
}
}