MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / draw

Function draw

atomic-cli/src/commands/git/agent_mode.rs:25–62  ·  view source on GitHub ↗
(frame: &mut Frame, elapsed: Duration, status: &str)

Source from the content-addressed store, hash-verified

23const ART: &str = include_str!("ascii_dancer.txt");
24
25fn draw(frame: &mut Frame, elapsed: Duration, status: &str) {
26 let area = frame.area();
27 let rows = Layout::vertical([
28 Constraint::Length(3),
29 Constraint::Min(1),
30 Constraint::Length(3),
31 ])
32 .split(area);
33 frame.render_widget(
34 Paragraph::new(format!(
35 "Agent mode / importing {:.1}s",
36 elapsed.as_secs_f64()
37 ))
38 .centered()
39 .block(
40 Block::bordered()
41 .title(" ATOMIC / AGENT MODE ")
42 .border_style(Style::default().fg(Color::Cyan)),
43 ),
44 rows[0],
45 );
46 dance(frame, rows[1], elapsed);
47 frame.render_widget(
48 Paragraph::new(if status.is_empty() {
49 "Import is running. Keep dancing..."
50 } else {
51 status
52 })
53 .wrap(Wrap { trim: true })
54 .style(Style::default().fg(Color::Gray))
55 .block(
56 Block::bordered()
57 .title(" Import status ")
58 .border_style(Style::default().fg(Color::DarkGray)),
59 ),
60 rows[2],
61 );
62}
63
64fn dance(frame: &mut Frame, area: Rect, elapsed: Duration) {
65 if area.width < 4 || area.height < 3 {

Callers 2

startMethod · 0.70

Calls 2

danceFunction · 0.85
is_emptyMethod · 0.45