2025-09-26 07:13:13 -07:00
|
|
|
use crossterm::event::KeyCode;
|
|
|
|
|
use crossterm::event::KeyModifiers;
|
|
|
|
|
use ratatui::buffer::Buffer;
|
|
|
|
|
use ratatui::layout::Rect;
|
|
|
|
|
use ratatui::style::Stylize;
|
|
|
|
|
use ratatui::text::Line;
|
|
|
|
|
use ratatui::text::Span;
|
|
|
|
|
use ratatui::widgets::WidgetRef;
|
|
|
|
|
|
|
|
|
|
#[derive(Clone, Copy, Debug)]
|
2025-09-26 18:24:26 -07:00
|
|
|
pub(crate) struct FooterProps {
|
|
|
|
|
pub(crate) mode: FooterMode,
|
2025-09-26 07:13:13 -07:00
|
|
|
pub(crate) esc_backtrack_hint: bool,
|
|
|
|
|
pub(crate) use_shift_enter_hint: bool,
|
2025-09-26 18:24:26 -07:00
|
|
|
pub(crate) is_task_running: bool,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
|
|
|
|
pub(crate) enum FooterMode {
|
|
|
|
|
CtrlCReminder,
|
|
|
|
|
ShortcutPrompt,
|
|
|
|
|
ShortcutOverlay,
|
|
|
|
|
EscHint,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub(crate) fn toggle_shortcut_mode(current: FooterMode, ctrl_c_hint: bool) -> FooterMode {
|
|
|
|
|
if ctrl_c_hint {
|
|
|
|
|
return current;
|
|
|
|
|
}
|
|
|
|
|
match current {
|
|
|
|
|
FooterMode::ShortcutOverlay | FooterMode::CtrlCReminder => FooterMode::ShortcutPrompt,
|
|
|
|
|
_ => FooterMode::ShortcutOverlay,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub(crate) fn esc_hint_mode(current: FooterMode, is_task_running: bool) -> FooterMode {
|
|
|
|
|
if is_task_running {
|
|
|
|
|
current
|
|
|
|
|
} else {
|
|
|
|
|
FooterMode::EscHint
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub(crate) fn reset_mode_after_activity(current: FooterMode) -> FooterMode {
|
|
|
|
|
match current {
|
|
|
|
|
FooterMode::EscHint | FooterMode::ShortcutOverlay => FooterMode::ShortcutPrompt,
|
|
|
|
|
other => other,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub(crate) fn prompt_mode() -> FooterMode {
|
|
|
|
|
FooterMode::ShortcutPrompt
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub(crate) fn footer_height(props: FooterProps) -> u16 {
|
|
|
|
|
footer_lines(props).len() as u16
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub(crate) fn render_footer(area: Rect, buf: &mut Buffer, props: FooterProps) {
|
|
|
|
|
let lines = footer_lines(props);
|
|
|
|
|
for (idx, line) in lines.into_iter().enumerate() {
|
|
|
|
|
let y = area.y + idx as u16;
|
|
|
|
|
if y >= area.y + area.height {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
let row = Rect::new(area.x, y, area.width, 1);
|
|
|
|
|
line.render_ref(row, buf);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn footer_lines(props: FooterProps) -> Vec<Line<'static>> {
|
|
|
|
|
match props.mode {
|
|
|
|
|
FooterMode::CtrlCReminder => {
|
|
|
|
|
vec![ctrl_c_reminder_line(CtrlCReminderState {
|
|
|
|
|
is_task_running: props.is_task_running,
|
|
|
|
|
})]
|
|
|
|
|
}
|
|
|
|
|
FooterMode::ShortcutPrompt => vec![Line::from(vec!["? for shortcuts".dim()])],
|
|
|
|
|
FooterMode::ShortcutOverlay => shortcut_overlay_lines(ShortcutsState {
|
|
|
|
|
use_shift_enter_hint: props.use_shift_enter_hint,
|
|
|
|
|
esc_backtrack_hint: props.esc_backtrack_hint,
|
|
|
|
|
is_task_running: props.is_task_running,
|
|
|
|
|
}),
|
|
|
|
|
FooterMode::EscHint => {
|
|
|
|
|
vec![esc_hint_line(ShortcutsState {
|
|
|
|
|
use_shift_enter_hint: props.use_shift_enter_hint,
|
|
|
|
|
esc_backtrack_hint: props.esc_backtrack_hint,
|
|
|
|
|
is_task_running: props.is_task_running,
|
|
|
|
|
})]
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-09-26 07:13:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Clone, Copy, Debug)]
|
|
|
|
|
struct CtrlCReminderState {
|
2025-09-26 18:24:26 -07:00
|
|
|
is_task_running: bool,
|
2025-09-26 07:13:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Clone, Copy, Debug)]
|
|
|
|
|
struct ShortcutsState {
|
2025-09-26 18:24:26 -07:00
|
|
|
use_shift_enter_hint: bool,
|
|
|
|
|
esc_backtrack_hint: bool,
|
|
|
|
|
is_task_running: bool,
|
2025-09-26 07:13:13 -07:00
|
|
|
}
|
|
|
|
|
|
2025-09-26 18:24:26 -07:00
|
|
|
fn ctrl_c_reminder_line(state: CtrlCReminderState) -> Line<'static> {
|
|
|
|
|
let action = if state.is_task_running {
|
|
|
|
|
"interrupt"
|
|
|
|
|
} else {
|
|
|
|
|
"quit"
|
|
|
|
|
};
|
|
|
|
|
Line::from(vec![
|
|
|
|
|
Span::from(format!(" ctrl + c again to {action}")).dim(),
|
|
|
|
|
])
|
2025-09-26 07:13:13 -07:00
|
|
|
}
|
|
|
|
|
|
2025-09-26 18:24:26 -07:00
|
|
|
fn esc_hint_line(state: ShortcutsState) -> Line<'static> {
|
|
|
|
|
let text = if state.esc_backtrack_hint {
|
|
|
|
|
" esc again to edit previous message"
|
2025-09-26 07:13:13 -07:00
|
|
|
} else {
|
2025-09-26 18:24:26 -07:00
|
|
|
" esc esc to edit previous message"
|
2025-09-26 07:13:13 -07:00
|
|
|
};
|
2025-09-26 18:24:26 -07:00
|
|
|
Line::from(vec![Span::from(text).dim()])
|
|
|
|
|
}
|
2025-09-26 07:13:13 -07:00
|
|
|
|
2025-09-26 18:24:26 -07:00
|
|
|
fn shortcut_overlay_lines(state: ShortcutsState) -> Vec<Line<'static>> {
|
|
|
|
|
let mut rendered = Vec::new();
|
|
|
|
|
for descriptor in SHORTCUTS {
|
|
|
|
|
if let Some(text) = descriptor.overlay_entry(state) {
|
|
|
|
|
rendered.push(text);
|
|
|
|
|
}
|
2025-09-26 07:13:13 -07:00
|
|
|
}
|
2025-09-26 18:24:26 -07:00
|
|
|
build_columns(rendered)
|
2025-09-26 07:13:13 -07:00
|
|
|
}
|
|
|
|
|
|
2025-09-26 18:24:26 -07:00
|
|
|
fn build_columns(entries: Vec<String>) -> Vec<Line<'static>> {
|
|
|
|
|
if entries.is_empty() {
|
|
|
|
|
return Vec::new();
|
2025-09-26 07:13:13 -07:00
|
|
|
}
|
|
|
|
|
|
2025-09-26 18:24:26 -07:00
|
|
|
const COLUMNS: usize = 3;
|
|
|
|
|
const MAX_PADDED_WIDTHS: [usize; COLUMNS - 1] = [24, 28];
|
2025-09-26 22:54:38 -07:00
|
|
|
const MIN_PADDED_WIDTHS: [usize; COLUMNS - 1] = [22, 0];
|
2025-09-26 07:13:13 -07:00
|
|
|
|
2025-09-26 18:24:26 -07:00
|
|
|
let rows = entries.len().div_ceil(COLUMNS);
|
|
|
|
|
let mut column_widths = [0usize; COLUMNS];
|
|
|
|
|
|
|
|
|
|
for (idx, entry) in entries.iter().enumerate() {
|
|
|
|
|
let column = idx % COLUMNS;
|
|
|
|
|
column_widths[column] = column_widths[column].max(entry.len());
|
2025-09-26 07:13:13 -07:00
|
|
|
}
|
|
|
|
|
|
2025-09-26 18:24:26 -07:00
|
|
|
let mut lines = Vec::new();
|
|
|
|
|
for row in 0..rows {
|
|
|
|
|
let mut line = String::from(" ");
|
|
|
|
|
for col in 0..COLUMNS {
|
|
|
|
|
let idx = row * COLUMNS + col;
|
|
|
|
|
if idx >= entries.len() {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
let entry = &entries[idx];
|
|
|
|
|
if col < COLUMNS - 1 {
|
|
|
|
|
let max_width = MAX_PADDED_WIDTHS[col];
|
2025-09-26 22:54:38 -07:00
|
|
|
let mut target_width = column_widths[col];
|
|
|
|
|
target_width = target_width.max(MIN_PADDED_WIDTHS[col]).min(max_width);
|
2025-09-26 18:24:26 -07:00
|
|
|
let pad_width = target_width + 2;
|
|
|
|
|
line.push_str(&format!("{entry:<pad_width$}"));
|
|
|
|
|
} else {
|
|
|
|
|
if col != 0 {
|
|
|
|
|
line.push_str(" ");
|
|
|
|
|
}
|
|
|
|
|
line.push_str(entry);
|
2025-09-26 07:13:13 -07:00
|
|
|
}
|
|
|
|
|
}
|
2025-09-26 18:24:26 -07:00
|
|
|
lines.push(Line::from(vec![Span::from(line).dim()]));
|
2025-09-26 07:13:13 -07:00
|
|
|
}
|
|
|
|
|
|
2025-09-26 18:24:26 -07:00
|
|
|
lines
|
2025-09-26 07:13:13 -07:00
|
|
|
}
|
|
|
|
|
|
2025-09-26 18:24:26 -07:00
|
|
|
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
2025-09-26 07:13:13 -07:00
|
|
|
enum ShortcutId {
|
2025-09-26 18:24:26 -07:00
|
|
|
Commands,
|
2025-09-26 07:13:13 -07:00
|
|
|
InsertNewline,
|
2025-09-26 22:54:38 -07:00
|
|
|
ChangeMode,
|
|
|
|
|
FilePaths,
|
2025-09-26 18:24:26 -07:00
|
|
|
PasteImage,
|
2025-09-26 22:54:38 -07:00
|
|
|
EditPrevious,
|
2025-09-26 07:13:13 -07:00
|
|
|
Quit,
|
2025-09-26 18:24:26 -07:00
|
|
|
ShowTranscript,
|
2025-09-26 07:13:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
|
|
|
|
struct ShortcutBinding {
|
|
|
|
|
code: KeyCode,
|
|
|
|
|
modifiers: KeyModifiers,
|
2025-09-26 18:24:26 -07:00
|
|
|
overlay_text: &'static str,
|
2025-09-26 07:13:13 -07:00
|
|
|
condition: DisplayCondition,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl ShortcutBinding {
|
2025-09-26 18:24:26 -07:00
|
|
|
fn matches(&self, state: ShortcutsState) -> bool {
|
|
|
|
|
self.condition.matches(state)
|
2025-09-26 07:13:13 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
|
|
|
|
enum DisplayCondition {
|
|
|
|
|
Always,
|
|
|
|
|
WhenShiftEnterHint,
|
|
|
|
|
WhenNotShiftEnterHint,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl DisplayCondition {
|
|
|
|
|
fn matches(self, state: ShortcutsState) -> bool {
|
|
|
|
|
match self {
|
|
|
|
|
DisplayCondition::Always => true,
|
|
|
|
|
DisplayCondition::WhenShiftEnterHint => state.use_shift_enter_hint,
|
|
|
|
|
DisplayCondition::WhenNotShiftEnterHint => !state.use_shift_enter_hint,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ShortcutDescriptor {
|
|
|
|
|
id: ShortcutId,
|
|
|
|
|
bindings: &'static [ShortcutBinding],
|
2025-09-26 18:24:26 -07:00
|
|
|
prefix: &'static str,
|
|
|
|
|
label: &'static str,
|
2025-09-26 07:13:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl ShortcutDescriptor {
|
2025-09-26 18:24:26 -07:00
|
|
|
fn binding_for(&self, state: ShortcutsState) -> Option<&'static ShortcutBinding> {
|
|
|
|
|
self.bindings.iter().find(|binding| binding.matches(state))
|
2025-09-26 07:13:13 -07:00
|
|
|
}
|
|
|
|
|
|
2025-09-26 18:24:26 -07:00
|
|
|
fn overlay_entry(&self, state: ShortcutsState) -> Option<String> {
|
2025-09-26 07:13:13 -07:00
|
|
|
let binding = self.binding_for(state)?;
|
2025-09-26 18:24:26 -07:00
|
|
|
let label = match self.id {
|
|
|
|
|
ShortcutId::Quit => {
|
|
|
|
|
if state.is_task_running {
|
|
|
|
|
" to interrupt"
|
|
|
|
|
} else {
|
|
|
|
|
self.label
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
ShortcutId::EditPrevious => {
|
|
|
|
|
if state.esc_backtrack_hint {
|
|
|
|
|
" again to edit previous message"
|
|
|
|
|
} else {
|
|
|
|
|
" esc to edit previous message"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
_ => self.label,
|
|
|
|
|
};
|
|
|
|
|
let text = match self.id {
|
|
|
|
|
ShortcutId::Quit if state.is_task_running => {
|
|
|
|
|
format!("{}{} to interrupt", self.prefix, binding.overlay_text)
|
|
|
|
|
}
|
|
|
|
|
_ => format!("{}{}{}", self.prefix, binding.overlay_text, label),
|
|
|
|
|
};
|
|
|
|
|
Some(text)
|
2025-09-26 07:13:13 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const SHORTCUTS: &[ShortcutDescriptor] = &[
|
|
|
|
|
ShortcutDescriptor {
|
2025-09-26 18:24:26 -07:00
|
|
|
id: ShortcutId::Commands,
|
2025-09-26 07:13:13 -07:00
|
|
|
bindings: &[ShortcutBinding {
|
2025-09-26 18:24:26 -07:00
|
|
|
code: KeyCode::Char('/'),
|
2025-09-26 07:13:13 -07:00
|
|
|
modifiers: KeyModifiers::NONE,
|
2025-09-26 18:24:26 -07:00
|
|
|
overlay_text: "/",
|
2025-09-26 07:13:13 -07:00
|
|
|
condition: DisplayCondition::Always,
|
|
|
|
|
}],
|
2025-09-26 18:24:26 -07:00
|
|
|
prefix: "",
|
|
|
|
|
label: " for commands",
|
|
|
|
|
},
|
2025-09-26 07:13:13 -07:00
|
|
|
ShortcutDescriptor {
|
|
|
|
|
id: ShortcutId::InsertNewline,
|
|
|
|
|
bindings: &[
|
|
|
|
|
ShortcutBinding {
|
|
|
|
|
code: KeyCode::Enter,
|
|
|
|
|
modifiers: KeyModifiers::SHIFT,
|
2025-09-26 18:24:26 -07:00
|
|
|
overlay_text: "shift + enter",
|
2025-09-26 07:13:13 -07:00
|
|
|
condition: DisplayCondition::WhenShiftEnterHint,
|
|
|
|
|
},
|
|
|
|
|
ShortcutBinding {
|
|
|
|
|
code: KeyCode::Char('j'),
|
|
|
|
|
modifiers: KeyModifiers::CONTROL,
|
2025-09-26 18:24:26 -07:00
|
|
|
overlay_text: "ctrl + j",
|
2025-09-26 07:13:13 -07:00
|
|
|
condition: DisplayCondition::WhenNotShiftEnterHint,
|
|
|
|
|
},
|
|
|
|
|
],
|
2025-09-26 18:24:26 -07:00
|
|
|
prefix: "",
|
|
|
|
|
label: " for newline",
|
2025-09-26 07:13:13 -07:00
|
|
|
},
|
2025-09-26 22:54:38 -07:00
|
|
|
ShortcutDescriptor {
|
|
|
|
|
id: ShortcutId::ChangeMode,
|
|
|
|
|
bindings: &[ShortcutBinding {
|
|
|
|
|
code: KeyCode::BackTab,
|
|
|
|
|
modifiers: KeyModifiers::SHIFT,
|
|
|
|
|
overlay_text: "shift + tab",
|
|
|
|
|
condition: DisplayCondition::Always,
|
|
|
|
|
}],
|
|
|
|
|
prefix: "",
|
|
|
|
|
label: " to change mode",
|
|
|
|
|
},
|
|
|
|
|
ShortcutDescriptor {
|
|
|
|
|
id: ShortcutId::FilePaths,
|
|
|
|
|
bindings: &[ShortcutBinding {
|
|
|
|
|
code: KeyCode::Char('@'),
|
|
|
|
|
modifiers: KeyModifiers::NONE,
|
|
|
|
|
overlay_text: "@",
|
|
|
|
|
condition: DisplayCondition::Always,
|
|
|
|
|
}],
|
|
|
|
|
prefix: "",
|
|
|
|
|
label: " for file paths",
|
|
|
|
|
},
|
2025-09-26 07:13:13 -07:00
|
|
|
ShortcutDescriptor {
|
2025-09-26 18:24:26 -07:00
|
|
|
id: ShortcutId::PasteImage,
|
2025-09-26 07:13:13 -07:00
|
|
|
bindings: &[ShortcutBinding {
|
2025-09-26 18:24:26 -07:00
|
|
|
code: KeyCode::Char('v'),
|
2025-09-26 07:13:13 -07:00
|
|
|
modifiers: KeyModifiers::CONTROL,
|
2025-09-26 18:24:26 -07:00
|
|
|
overlay_text: "ctrl + v",
|
2025-09-26 07:13:13 -07:00
|
|
|
condition: DisplayCondition::Always,
|
|
|
|
|
}],
|
2025-09-26 18:24:26 -07:00
|
|
|
prefix: "",
|
|
|
|
|
label: " to paste images",
|
2025-09-26 07:13:13 -07:00
|
|
|
},
|
2025-09-26 22:54:38 -07:00
|
|
|
ShortcutDescriptor {
|
|
|
|
|
id: ShortcutId::EditPrevious,
|
|
|
|
|
bindings: &[ShortcutBinding {
|
|
|
|
|
code: KeyCode::Esc,
|
|
|
|
|
modifiers: KeyModifiers::NONE,
|
|
|
|
|
overlay_text: "esc",
|
|
|
|
|
condition: DisplayCondition::Always,
|
|
|
|
|
}],
|
|
|
|
|
prefix: "",
|
|
|
|
|
label: "",
|
|
|
|
|
},
|
2025-09-26 07:13:13 -07:00
|
|
|
ShortcutDescriptor {
|
|
|
|
|
id: ShortcutId::Quit,
|
|
|
|
|
bindings: &[ShortcutBinding {
|
|
|
|
|
code: KeyCode::Char('c'),
|
|
|
|
|
modifiers: KeyModifiers::CONTROL,
|
2025-09-26 18:24:26 -07:00
|
|
|
overlay_text: "ctrl + c",
|
|
|
|
|
condition: DisplayCondition::Always,
|
|
|
|
|
}],
|
|
|
|
|
prefix: "",
|
|
|
|
|
label: " to exit",
|
|
|
|
|
},
|
|
|
|
|
ShortcutDescriptor {
|
|
|
|
|
id: ShortcutId::ShowTranscript,
|
|
|
|
|
bindings: &[ShortcutBinding {
|
|
|
|
|
code: KeyCode::Char('t'),
|
|
|
|
|
modifiers: KeyModifiers::CONTROL,
|
|
|
|
|
overlay_text: "ctrl + t",
|
2025-09-26 07:13:13 -07:00
|
|
|
condition: DisplayCondition::Always,
|
|
|
|
|
}],
|
2025-09-26 18:24:26 -07:00
|
|
|
prefix: "",
|
|
|
|
|
label: " to view transcript",
|
|
|
|
|
},
|
2025-09-26 07:13:13 -07:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
#[cfg(test)]
|
|
|
|
|
mod tests {
|
|
|
|
|
use super::*;
|
|
|
|
|
use insta::assert_snapshot;
|
|
|
|
|
use ratatui::Terminal;
|
|
|
|
|
use ratatui::backend::TestBackend;
|
|
|
|
|
|
2025-09-26 18:24:26 -07:00
|
|
|
fn snapshot_footer(name: &str, props: FooterProps) {
|
|
|
|
|
let height = footer_height(props).max(1);
|
|
|
|
|
let mut terminal = Terminal::new(TestBackend::new(80, height)).unwrap();
|
2025-09-26 07:13:13 -07:00
|
|
|
terminal
|
|
|
|
|
.draw(|f| {
|
2025-09-26 18:24:26 -07:00
|
|
|
let area = Rect::new(0, 0, f.area().width, height);
|
2025-09-26 07:13:13 -07:00
|
|
|
render_footer(area, f.buffer_mut(), props);
|
|
|
|
|
})
|
|
|
|
|
.unwrap();
|
|
|
|
|
assert_snapshot!(name, terminal.backend());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
fn footer_snapshots() {
|
|
|
|
|
snapshot_footer(
|
|
|
|
|
"footer_shortcuts_default",
|
|
|
|
|
FooterProps {
|
2025-09-26 18:24:26 -07:00
|
|
|
mode: FooterMode::ShortcutPrompt,
|
2025-09-26 07:13:13 -07:00
|
|
|
esc_backtrack_hint: false,
|
|
|
|
|
use_shift_enter_hint: false,
|
2025-09-26 18:24:26 -07:00
|
|
|
is_task_running: false,
|
2025-09-26 07:13:13 -07:00
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
snapshot_footer(
|
|
|
|
|
"footer_shortcuts_shift_and_esc",
|
|
|
|
|
FooterProps {
|
2025-09-26 18:24:26 -07:00
|
|
|
mode: FooterMode::ShortcutOverlay,
|
2025-09-26 07:13:13 -07:00
|
|
|
esc_backtrack_hint: true,
|
|
|
|
|
use_shift_enter_hint: true,
|
2025-09-26 18:24:26 -07:00
|
|
|
is_task_running: false,
|
2025-09-26 07:13:13 -07:00
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
snapshot_footer(
|
|
|
|
|
"footer_ctrl_c_quit_idle",
|
|
|
|
|
FooterProps {
|
2025-09-26 18:24:26 -07:00
|
|
|
mode: FooterMode::CtrlCReminder,
|
2025-09-26 07:13:13 -07:00
|
|
|
esc_backtrack_hint: false,
|
|
|
|
|
use_shift_enter_hint: false,
|
2025-09-26 18:24:26 -07:00
|
|
|
is_task_running: false,
|
2025-09-26 07:13:13 -07:00
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
snapshot_footer(
|
|
|
|
|
"footer_ctrl_c_quit_running",
|
|
|
|
|
FooterProps {
|
2025-09-26 18:24:26 -07:00
|
|
|
mode: FooterMode::CtrlCReminder,
|
|
|
|
|
esc_backtrack_hint: false,
|
|
|
|
|
use_shift_enter_hint: false,
|
2025-09-26 07:13:13 -07:00
|
|
|
is_task_running: true,
|
2025-09-26 18:24:26 -07:00
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
snapshot_footer(
|
|
|
|
|
"footer_esc_hint_idle",
|
|
|
|
|
FooterProps {
|
|
|
|
|
mode: FooterMode::EscHint,
|
2025-09-26 07:13:13 -07:00
|
|
|
esc_backtrack_hint: false,
|
|
|
|
|
use_shift_enter_hint: false,
|
2025-09-26 18:24:26 -07:00
|
|
|
is_task_running: false,
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
snapshot_footer(
|
|
|
|
|
"footer_esc_hint_primed",
|
|
|
|
|
FooterProps {
|
|
|
|
|
mode: FooterMode::EscHint,
|
|
|
|
|
esc_backtrack_hint: true,
|
|
|
|
|
use_shift_enter_hint: false,
|
|
|
|
|
is_task_running: false,
|
2025-09-26 07:13:13 -07:00
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|