T24b round 1 fix
- AgentProgress splits its bar only for two steps or more; a task of one step draws a plain bar - test a_task_of_one_step_draws_before_and_after renders 0 of 1 and 1 of 1
This commit is contained in:
1 parent
2d78db57a8
commit
85988b14d4
3 files changed
+35
-5
No files matched your search
@@ -246,7 +246,7 @@ impl RenderOnce for AgentStatus {
|
||||
}
|
||||
}
|
||||
|
||||
/// How far an agent has come: the step at work, how many are done of how many, the time so far, and a bar split by step.
|
||||
/// How far an agent has come: the step at work, how many are done of how many, the time so far, and a bar split by step when there are two or more.
|
||||
#[derive(IntoElement)]
|
||||
pub struct AgentProgress {
|
||||
id: ElementId,
|
||||
@@ -309,9 +309,13 @@ impl RenderOnce for AgentProgress {
|
||||
tabular(div().flex_none().text_color(colors.fg_subtle)).child(took(spent))
|
||||
})),
|
||||
)
|
||||
.child(
|
||||
ProgressBar::new((self.id, "bar"), self.done as f32 / self.total as f32)
|
||||
.segments(self.total),
|
||||
)
|
||||
.child({
|
||||
let bar = ProgressBar::new((self.id, "bar"), self.done as f32 / self.total as f32);
|
||||
if self.total >= 2 {
|
||||
bar.segments(self.total)
|
||||
} else {
|
||||
bar
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user