feat(tui): add help overlay shortcuts (F1/?) and update help UI and status messages
- Introduced a new “HELP & QUICK COMMANDS” section with bold header and shortcuts for toggling the help overlay and opening the files panel. - Updated command help text to “Open the help overlay”. - Extended onboarding and tutorial status lines to display the help shortcut. - Modified help command handling to set the status to “Help” and clear errors.
This commit is contained in:
@@ -57,10 +57,11 @@ use serde_json::{Value, json};
|
||||
|
||||
const ONBOARDING_STATUS_LINE: &str =
|
||||
"Welcome to Owlen! Press F1 for help or type :tutorial for keybinding tips.";
|
||||
const ONBOARDING_SYSTEM_STATUS: &str = "Normal ▸ h/j/k/l • Insert ▸ i,a • Visual ▸ v • Command ▸ :";
|
||||
const ONBOARDING_SYSTEM_STATUS: &str =
|
||||
"Normal ▸ h/j/k/l • Insert ▸ i,a • Visual ▸ v • Command ▸ : • Help ▸ F1/?";
|
||||
const TUTORIAL_STATUS: &str = "Tutorial loaded. Review quick tips in the footer.";
|
||||
const TUTORIAL_SYSTEM_STATUS: &str =
|
||||
"Normal ▸ h/j/k/l • Insert ▸ i,a • Visual ▸ v • Command ▸ : • Send ▸ Enter";
|
||||
"Normal ▸ h/j/k/l • Insert ▸ i,a • Visual ▸ v • Command ▸ : • Help ▸ F1/? • Send ▸ Enter";
|
||||
|
||||
const FOCUS_CHORD_TIMEOUT: Duration = Duration::from_millis(1200);
|
||||
const RESIZE_DOUBLE_TAP_WINDOW: Duration = Duration::from_millis(450);
|
||||
@@ -5575,6 +5576,8 @@ impl ChatApp {
|
||||
}
|
||||
"h" | "help" => {
|
||||
self.set_input_mode(InputMode::Help);
|
||||
self.status = "Help".to_string();
|
||||
self.error = None;
|
||||
self.command_palette.clear();
|
||||
return Ok(AppState::Running);
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ const COMMANDS: &[CommandSpec] = &[
|
||||
},
|
||||
CommandSpec {
|
||||
keyword: "help",
|
||||
description: "Show help documentation",
|
||||
description: "Open the help overlay",
|
||||
},
|
||||
CommandSpec {
|
||||
keyword: "h",
|
||||
|
||||
@@ -3061,6 +3061,14 @@ fn render_help(frame: &mut Frame<'_>, app: &ChatApp) {
|
||||
Line::from(" Ctrl+d/u → scroll half page down/up"),
|
||||
Line::from(" Ctrl+f/b → scroll full page down/up"),
|
||||
Line::from(" PageUp/Down → scroll full page"),
|
||||
Line::from(""),
|
||||
Line::from(vec![Span::styled(
|
||||
"HELP & QUICK COMMANDS",
|
||||
Style::default().add_modifier(Modifier::BOLD).fg(theme.info),
|
||||
)]),
|
||||
Line::from(" F1 / ? → toggle help overlay"),
|
||||
Line::from(" :h, :help → open help from command mode"),
|
||||
Line::from(" :files, :explorer → toggle files panel"),
|
||||
],
|
||||
1 => vec![
|
||||
// Editing
|
||||
@@ -3171,6 +3179,8 @@ fn render_help(frame: &mut Frame<'_>, app: &ChatApp) {
|
||||
.fg(theme.user_message_role),
|
||||
)]),
|
||||
Line::from(" :h, :help → show this help"),
|
||||
Line::from(" F1 or ? → toggle help overlay"),
|
||||
Line::from(" :files, :explorer → toggle files panel"),
|
||||
Line::from(" :quit → quit application"),
|
||||
Line::from(" Ctrl+C twice → quit application"),
|
||||
Line::from(" :reload → reload configuration and themes"),
|
||||
|
||||
Reference in New Issue
Block a user