use ratatui::style::{Color, Modifier, Style};
use ratatui::text::Line;
pub struct HelpText;
impl HelpText {
#[must_use]
pub fn left_column() -> Vec<Line<'static>> {
vec![
Line::from("SQL CLI Help - Enhanced Features ๐").style(
Style::default()
.fg(Color::Cyan)
.add_modifier(Modifier::BOLD),
),
Line::from(""),
Line::from("COMMAND MODE").style(
Style::default()
.fg(Color::Yellow)
.add_modifier(Modifier::BOLD),
),
Line::from(" Enter - Execute query"),
Line::from(" Tab - Auto-complete"),
Line::from(" F2 - Switch to Results mode"),
Line::from(" Ctrl+R - Search history"),
Line::from(" Ctrl+P - Previous command in history"),
Line::from(" Ctrl+N - Next command in history"),
Line::from(" Alt+โ - Previous command (alternative)"),
Line::from(" Alt+โ - Next command (alternative)"),
Line::from(" Ctrl+X - Expand SELECT * to all columns"),
Line::from(" Alt+X - Expand SELECT * to visible columns only"),
Line::from(" F3 - Show pretty-printed query"),
Line::from(""),
Line::from("NAVIGATION").style(
Style::default()
.fg(Color::Yellow)
.add_modifier(Modifier::BOLD),
),
Line::from(" Ctrl+A - Beginning of line"),
Line::from(" Ctrl+E - End of line"),
Line::from(" Ctrl+โ - Move backward word"),
Line::from(" Ctrl+โ - Move forward word"),
Line::from(" Alt+B - Move backward word (bash-style)"),
Line::from(" Alt+F - Move forward word (bash-style)"),
Line::from(""),
Line::from("EDITING").style(
Style::default()
.fg(Color::Yellow)
.add_modifier(Modifier::BOLD),
),
Line::from(" Ctrl+W - Delete word backward"),
Line::from(" Alt+D - Delete word forward"),
Line::from(" Ctrl+K - Kill to end of line"),
Line::from(" Ctrl+U - Kill to beginning of line"),
Line::from(" F9 - Kill to end (Ctrl+K alternative)"),
Line::from(" F10 - Kill to beginning (Ctrl+U alternative)"),
Line::from(" Ctrl+Y - Yank (paste from kill ring)"),
Line::from(" Ctrl+V - Paste from system clipboard"),
Line::from(" Ctrl+Z - Undo"),
Line::from(" Alt+[ - Jump to previous SQL token"),
Line::from(" Alt+] - Jump to next SQL token"),
Line::from(""),
Line::from("BUFFER MANAGEMENT (works in Command & Results modes)").style(
Style::default()
.fg(Color::Yellow)
.add_modifier(Modifier::BOLD),
),
Line::from(" F11 - Previous buffer"),
Line::from(" Ctrl+PgUp - Previous buffer (alternative)"),
Line::from(" Ctrl+PgDn - Next buffer"),
Line::from(" Ctrl+6 - Quick switch (toggle last two)"),
Line::from(" Alt+N - New buffer"),
Line::from(" Alt+W - Close buffer"),
Line::from(" Alt+B - List buffers"),
Line::from(" Alt+1-9 - Switch to buffer N"),
Line::from(""),
Line::from("VIEW MODES").style(
Style::default()
.fg(Color::Yellow)
.add_modifier(Modifier::BOLD),
),
Line::from(" F1/? - Toggle this help"),
Line::from(" F5 - Debug info"),
Line::from(" F6 - Toggle row numbers"),
Line::from(" F8 - Case-insensitive"),
Line::from(" โ - Enter results mode"),
Line::from(" Ctrl+C/q - Exit"),
Line::from(""),
Line::from("๐ FEATURES").style(
Style::default()
.fg(Color::Magenta)
.add_modifier(Modifier::BOLD),
),
Line::from(" โข Column statistics (S key)"),
Line::from(" โข Column pinning (p/P keys)"),
Line::from(" โข Dynamic column sizing"),
Line::from(" โข Compact mode (C key)"),
Line::from(" โข Rainbow parentheses"),
Line::from(" โข Auto-execute CSV/JSON"),
Line::from(" โข Multi-source indicators"),
Line::from(" โข LINQ-style null checking"),
Line::from(" โข Row numbers (N key)"),
Line::from(" โข Jump to row (: key)"),
]
}
#[must_use]
pub fn right_column() -> Vec<Line<'static>> {
vec![
Line::from("Use โ/โ or j/k to scroll help").style(Style::default().fg(Color::DarkGray)),
Line::from(""),
Line::from("RESULTS NAVIGATION").style(
Style::default()
.fg(Color::Yellow)
.add_modifier(Modifier::BOLD),
),
Line::from(" j/โ - Next row"),
Line::from(" k/โ - Previous row"),
Line::from(" h/โ - Previous column"),
Line::from(" l/โ - Next column"),
Line::from(" 5j - โก Move down 5 rows (vim counts)"),
Line::from(" 3k - โก Move up 3 rows (vim counts)"),
Line::from(" 10l - โก Move right 10 columns"),
Line::from(" g - First row"),
Line::from(" G - Last row"),
Line::from(" H - Top of viewport"),
Line::from(" M - Middle of viewport"),
Line::from(" L - Bottom of viewport"),
Line::from(" 0/^ - First column"),
Line::from(" $ - Last column"),
Line::from(" PgDn - Page down"),
Line::from(" PgUp - Page up"),
Line::from(""),
Line::from("RESULTS FEATURES").style(
Style::default()
.fg(Color::Yellow)
.add_modifier(Modifier::BOLD),
),
Line::from(" C - ๐ฏ Toggle compact (binary on/off)"),
Line::from(" Alt+S - ๐ Cycle column packing"),
Line::from(" (Balanced โ Data Focus โ Header Focus)"),
Line::from(" N - ๐ข Toggle row nums"),
Line::from(" : - ๐ Jump to row"),
Line::from(" Space - ๐ Toggle viewport lock"),
Line::from(" Ctrl+Space - ๐ Toggle viewport lock (alternative)"),
Line::from(" x/X - ๐ Toggle cursor lock"),
Line::from(" p - ๐ Pin/unpin column"),
Line::from(" P - Clear all pins"),
Line::from(" - - ๐๏ธ Hide current column"),
Line::from(" e/E - ๐๏ธ Hide empty columns"),
Line::from(" +/= - ๐๏ธ Unhide all columns"),
Line::from(" < - โ๏ธ Move column left"),
Line::from(" > - โ๏ธ Move column right"),
Line::from(" / - ๐ Vim search (type, Enter to confirm)"),
Line::from(" n - Next search match"),
Line::from(" N - Previous search match"),
Line::from(" \\ - Search column names"),
Line::from(" Shift+F - Filter rows (regex)"),
Line::from(" f - Fuzzy filter rows"),
Line::from(" 'text - Exact match filter"),
Line::from(" (matches highlighted)"),
Line::from(" v - Toggle cell/row mode"),
Line::from(" s - Sort by column"),
Line::from(" S - ๐ Column statistics"),
Line::from(" y - Yank (cell mode: yank cell)"),
Line::from(" yy - Yank current row (row mode)"),
Line::from(" yc - Yank current column"),
Line::from(" yv - Yank current cell (any mode)"),
Line::from(" ya - Yank all data"),
Line::from(" yq - Yank current query"),
Line::from(" c - SQL clause navigation:"),
Line::from(" cw - Jump to WHERE clause"),
Line::from(" cs - Jump to SELECT clause"),
Line::from(" cf - Jump to FROM clause"),
Line::from(" co - Jump to ORDER BY"),
Line::from(" cg - Jump to GROUP BY"),
Line::from(" ch - Jump to HAVING clause"),
Line::from(" cl - Jump to LIMIT clause"),
Line::from(" i/F2/Esc - Back to command (i=vim insert)"),
Line::from(" q - Quit"),
Line::from(""),
Line::from("EXPORT DATA ๐ค").style(
Style::default()
.fg(Color::Green)
.add_modifier(Modifier::BOLD),
),
Line::from(" Ctrl+E - Export to CSV file"),
Line::from(" Ctrl+J - Export to JSON file"),
Line::from(" (files saved with timestamp)"),
Line::from(""),
Line::from("SEARCH/FILTER").style(
Style::default()
.fg(Color::Yellow)
.add_modifier(Modifier::BOLD),
),
Line::from(" Enter - Apply"),
Line::from(" Esc - Cancel"),
Line::from(""),
Line::from("DEBUG MODE (F5)")
.style(Style::default().fg(Color::Red).add_modifier(Modifier::BOLD)),
Line::from(" g/G - Go to top/bottom"),
Line::from(" j/k - Scroll up/down"),
Line::from(" PgUp/Dn - Page up/down"),
Line::from(" Ctrl+T - Yank as test case โจ"),
Line::from(" Shift+Y - Yank debug context โจ"),
Line::from(" Esc/q - Exit debug mode"),
Line::from(""),
Line::from("๐ก TIPS").style(
Style::default()
.fg(Color::Green)
.add_modifier(Modifier::BOLD),
),
Line::from(" โข Load CSV: sql-cli data.csv"),
Line::from(" โข Press C for compact view"),
Line::from(" โข Press N for row numbers"),
Line::from(" โข Press : then 200 โ row 200"),
Line::from(" โข Vim counts: 5j, 10k, 3h, 7l"),
Line::from(" โข Press 'i' for vim-style insert"),
Line::from(" โข cw/cs/cf = jump to SQL clauses"),
Line::from(" โข Space locks viewport"),
Line::from(" โข Columns auto-adjust width"),
Line::from(" โข f + 'ubs = exact 'ubs' match"),
Line::from(" โข \\ + name = find column by name"),
Line::from(" โข F5 + Ctrl+T = Auto-generate tests!"),
Line::from(""),
Line::from("๐ File ๐ API ๐๏ธ SQL ๐งช Test"),
]
}
}