Skip to content

Commit 2640b4e

Browse files
committed
ui: refresh completion footer bindings
1 parent f16d7e3 commit 2640b4e

2 files changed

Lines changed: 26 additions & 20 deletions

File tree

crates/intar-ui/src/app.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,8 +1009,8 @@ impl App {
10091009
fn draw_overlays(&self, f: &mut ratatui::Frame, area: Rect) {
10101010
if self.flags.show_confirm_reset {
10111011
let dialog = ConfirmDialog {
1012-
title: "Reset Scenario",
1013-
message: "Reset scenario to initial state?\nAll progress will be lost.",
1012+
title: "Restart Scenario",
1013+
message: "Restart scenario from the initial state?\nAll progress will be lost.",
10141014
theme: &self.theme,
10151015
};
10161016
f.render_widget(dialog, area);

crates/intar-ui/src/widgets.rs

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,7 @@ impl CompletedScreen<'_> {
169169
fn render_footer(&self, area: Rect, buf: &mut Buffer) {
170170
let block = Block::default()
171171
.borders(Borders::ALL)
172-
.padding(Padding::uniform(1))
173-
.border_type(BorderType::Plain)
172+
.border_type(BorderType::Thick)
174173
.border_style(Style::default().fg(self.theme.border))
175174
.style(Style::default().bg(self.theme.surface));
176175

@@ -190,23 +189,30 @@ impl CompletedScreen<'_> {
190189
.bold()
191190
};
192191

193-
let spans = vec![
194-
Span::styled(" Q ", key_style),
195-
Span::raw(" quit "),
196-
Span::styled(" R ", key_style),
197-
Span::raw(" reset "),
198-
Span::styled(" T ", key_style),
199-
Span::raw(" theme"),
192+
let keys = vec![
193+
("?", "Help"),
194+
("R", "Restart"),
195+
("T", "Theme"),
196+
("Q", "Quit"),
200197
];
201198

199+
let mut spans = Vec::new();
200+
for (key, desc) in keys {
201+
spans.push(Span::styled(format!(" {key} "), key_style));
202+
spans.push(Span::styled(
203+
format!(" {desc} "),
204+
Style::default().fg(self.theme.dim),
205+
));
206+
spans.push(Span::raw(" "));
207+
}
208+
209+
let content_area = Layout::vertical([Constraint::Length(1)])
210+
.flex(ratatui::layout::Flex::Center)
211+
.split(inner)[0];
212+
202213
Paragraph::new(Line::from(spans))
203-
.alignment(Alignment::Center)
204-
.style(
205-
Style::default()
206-
.fg(self.theme.secondary)
207-
.bg(self.theme.surface),
208-
)
209-
.render(inner, buf);
214+
.alignment(Alignment::Left)
215+
.render(content_area, buf);
210216
}
211217
}
212218

@@ -670,7 +676,7 @@ impl ScenarioTreeScreen<'_> {
670676
("PGUP/PGDN", "Scroll"),
671677
("?", "Help"),
672678
("T", "Theme"),
673-
("R", "Reset"),
679+
("R", "Restart"),
674680
("Q", "Quit"),
675681
];
676682

@@ -928,7 +934,7 @@ impl Widget for HelpOverlay<'_> {
928934
]),
929935
Line::from(vec![
930936
Span::styled(" R ", key_style),
931-
Span::raw(" Reset scenario"),
937+
Span::raw(" Restart scenario"),
932938
]),
933939
Line::from(vec![
934940
Span::styled(" T ", key_style),

0 commit comments

Comments
 (0)