feat(tui/help): include Slash Commands section in Ctrl+H and rely on existing scroll nav\n\n- Append a "Slash commands" list to the Help overlay using the enum source of truth\n- Keeps help scrollable with Up/Down/PageUp/PageDown/Home/End

This commit is contained in:
James Peter
2025-09-08 12:02:07 +10:00
parent d73530693f
commit e00a4ecd56
+13
View File
@@ -3325,6 +3325,19 @@ impl ChatWidget<'_> {
lines.push(kv("Ctrl+B", "Toggle Browser panel")); lines.push(kv("Ctrl+B", "Toggle Browser panel"));
lines.push(kv("Ctrl+A", "Toggle Agents panel")); lines.push(kv("Ctrl+A", "Toggle Agents panel"));
// Slash command reference
lines.push(RtLine::from(""));
lines.push(RtLine::from(vec![RtSpan::styled("Slash commands", t_fg.add_modifier(Modifier::BOLD))]));
for (cmd_str, cmd) in crate::slash_command::built_in_slash_commands() {
let desc = cmd.description();
// Render as "/command — description"
lines.push(RtLine::from(vec![
RtSpan::styled(format!("/{cmd_str:>12}"), t_fg),
RtSpan::raw(" — "),
RtSpan::styled(desc.to_string(), t_dim),
]));
}
self.help.overlay = Some(HelpOverlay::new(lines)); self.help.overlay = Some(HelpOverlay::new(lines));
self.request_redraw(); self.request_redraw();
} }