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

Function draw_confirm_set

crates/openshell-tui/src/ui/sandbox_settings.rs:137–170  ·  view source on GitHub ↗
(frame: &mut Frame<'_>, app: &App, idx: usize, area: Rect)

Source from the content-addressed store, hash-verified

135}
136
137fn draw_confirm_set(frame: &mut Frame<'_>, app: &App, idx: usize, area: Rect) {
138 let t = &app.theme;
139 let Some(entry) = app.sandbox_settings.get(idx) else {
140 return;
141 };
142 let new_value = app
143 .sandbox_setting_edit
144 .as_ref()
145 .map_or("-", |e| e.input.as_str());
146 let sandbox_name = app.selected_sandbox_name().unwrap_or("-");
147
148 let lines = vec![
149 Line::from(Span::styled(" Confirm Sandbox Setting Change ", t.heading)),
150 Line::from(""),
151 Line::from(vec![
152 Span::styled("Set ", t.text),
153 Span::styled(&entry.key, t.accent),
154 Span::styled(" = ", t.text),
155 Span::styled(new_value, t.accent),
156 Span::styled(" for ", t.text),
157 Span::styled(sandbox_name, t.accent),
158 Span::styled("?", t.text),
159 ]),
160 Line::from(""),
161 Line::from(vec![
162 Span::styled("[y]", t.key_hint),
163 Span::styled(" Confirm ", t.muted),
164 Span::styled("[n]", t.key_hint),
165 Span::styled(" Cancel", t.muted),
166 ]),
167 ];
168
169 super::draw_confirm_popup(frame, lines, t.border_focused, 60, area);
170}
171
172fn draw_confirm_delete(frame: &mut Frame<'_>, app: &App, idx: usize, area: Rect) {
173 let t = &app.theme;

Callers 1

drawFunction · 0.70

Calls 4

draw_confirm_popupFunction · 0.85
selected_sandbox_nameMethod · 0.80
getMethod · 0.45
as_strMethod · 0.45

Tested by

no test coverage detected