MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / draw

Function draw

crates/openshell-tui/src/ui/mod.rs:26–67  ·  view source on GitHub ↗
(frame: &mut Frame<'_>, app: &mut App)

Source from the content-addressed store, hash-verified

24use crate::theme::Theme;
25
26pub fn draw(frame: &mut Frame<'_>, app: &mut App) {
27 // Splash screen is a full-screen takeover — no chrome.
28 if app.screen == Screen::Splash {
29 splash::draw(frame, frame.size(), &app.theme);
30 return;
31 }
32
33 let chunks = Layout::default()
34 .direction(Direction::Vertical)
35 .constraints([
36 Constraint::Length(1), // title bar
37 Constraint::Min(0), // main content
38 Constraint::Length(1), // nav bar
39 Constraint::Length(1), // command bar
40 ])
41 .split(frame.size());
42
43 draw_title_bar(frame, app, chunks[0]);
44
45 match app.screen {
46 Screen::Splash => unreachable!(),
47 Screen::Dashboard => dashboard::draw(frame, app, chunks[1]),
48 Screen::Sandbox => draw_sandbox_screen(frame, app, chunks[1]),
49 }
50
51 draw_nav_bar(frame, app, chunks[2]);
52 draw_command_bar(frame, app, chunks[3]);
53
54 // Modal overlays (drawn last so they're on top).
55 if app.create_form.is_some() {
56 create_sandbox::draw(frame, app, frame.size());
57 }
58 if app.create_provider_form.is_some() {
59 create_provider::draw(frame, app, frame.size());
60 }
61 if app.provider_detail.is_some() {
62 create_provider::draw_detail(frame, app, frame.size());
63 }
64 if app.update_provider_form.is_some() {
65 create_provider::draw_update(frame, app, frame.size());
66 }
67}
68
69// ---------------------------------------------------------------------------
70// Sandbox full-screen

Callers 2

draw_sandbox_screenFunction · 0.70
runFunction · 0.50

Calls 6

draw_title_barFunction · 0.85
draw_sandbox_screenFunction · 0.85
draw_nav_barFunction · 0.85
draw_command_barFunction · 0.85
draw_detailFunction · 0.85
draw_updateFunction · 0.85

Tested by

no test coverage detected