fix(tui): annotate update prompt literal arguments

This commit is contained in:
Felipe Coury
2026-05-09 16:55:02 -03:00
parent d0a905a557
commit f12a36c166
+11 -6
View File
@@ -277,21 +277,23 @@ impl WidgetRef for &UpdatePromptScreen {
.dim()
.underlined(),
])
.inset(Insets::tlbr(0, 2, 0, 0)),
.inset(Insets::tlbr(
/*top*/ 0, /*left*/ 2, /*bottom*/ 0, /*right*/ 0,
)),
);
column.push("");
column.push(selection_option_row(
0,
/*index*/ 0,
format!("Update now (runs `{update_command}`)"),
self.highlighted == UpdateSelection::UpdateNow,
));
column.push(selection_option_row(
1,
/*index*/ 1,
"Skip".to_string(),
self.highlighted == UpdateSelection::NotNow,
));
column.push(selection_option_row(
2,
/*index*/ 2,
"Skip until next version".to_string(),
self.highlighted == UpdateSelection::DontRemind,
));
@@ -302,7 +304,9 @@ impl WidgetRef for &UpdatePromptScreen {
key_hint::plain(KeyCode::Enter).into(),
" to continue".dim(),
])
.inset(Insets::tlbr(0, 2, 0, 0)),
.inset(Insets::tlbr(
/*top*/ 0, /*left*/ 2, /*bottom*/ 0, /*right*/ 0,
)),
);
column.render(area, buf);
}
@@ -423,7 +427,8 @@ mod tests {
#[test]
fn update_prompt_snapshot() {
let screen = new_prompt();
let mut terminal = Terminal::new(VT100Backend::new(80, 12)).expect("terminal");
let mut terminal =
Terminal::new(VT100Backend::new(/*width*/ 80, /*height*/ 12)).expect("terminal");
terminal
.draw(|frame| frame.render_widget_ref(&screen, frame.area()))
.expect("render update prompt");