use super::super::super::super::super::{Reply, WsRow};
use crate::binding::WorkspaceKind;
use crate::projects::join::JoinState;
fn workspaces() -> Vec<WsRow> {
let row = |name: &str, kind, attention, agents, running, pinned| WsRow {
workspace: name.to_owned(),
kind,
attention,
agents,
running,
pinned,
config_tip: (attention > 0).then(|| crate::model_pick::ConfigTip {
oid: "c".repeat(40),
short_oid: "cccccccc".into(),
}),
};
vec![
row(
"alba",
WorkspaceKind::Named {
name: "alba".into(),
},
2,
5,
true,
Some(1),
),
row("f", WorkspaceKind::Foreign, 0, 0, false, None),
row("r", WorkspaceKind::Replay, 0, 1, false, Some(0)),
]
}
pub(super) fn chrome() -> Vec<Reply> {
vec![
Reply::Workspaces(crate::boundary::reply::Workspaces {
rows: workspaces(),
stale: Some("derivation 31 s behind".into()),
growth: Some("brave-fox +12 branches".into()),
}),
Reply::Workspaces(crate::boundary::reply::Workspaces {
rows: workspaces(),
stale: None,
growth: None,
}),
Reply::WorkspaceBalls(vec![
crate::nav::BoundBall {
id: "bl-1".into(),
badge: Some("delivered".into()),
project: "p".into(),
owner: "alba".into(),
state: JoinState::Delivered,
spend: crate::spend::Figure {
tokens: crate::budgets::BudgetSpend {
input_tokens: 12,
..crate::budgets::BudgetSpend::default()
},
cost: Some(crate::spend::Cost {
micro_usd: 2_500_000,
unpriced_tokens: 3,
}),
attribution: crate::spend::Attribution::Conversations(2),
},
},
crate::nav::BoundBall {
id: "bl-2".into(),
badge: None,
project: "p".into(),
owner: "alba".into(),
state: JoinState::Bound,
spend: crate::spend::Figure {
tokens: crate::budgets::BudgetSpend::default(),
cost: None,
attribution: crate::spend::Attribution::Workspace,
},
},
]),
]
}