diff options
Diffstat (limited to 'tui.go')
| -rw-r--r-- | tui.go | 67 |
1 files changed, 50 insertions, 17 deletions
@@ -74,8 +74,6 @@ var ( [yellow]Ctrl+c[white]: close programm [yellow]Ctrl+n[white]: start a new chat [yellow]Ctrl+o[white]: open image file picker -[yellow]@[white]: file completion (type @ in input to get file suggestions) -[yellow]c[white]: (in file picker) set current dir as CodingDir [yellow]Ctrl+p[white]: props edit form (min-p, dry, etc.) [yellow]Ctrl+v[white]: show API link selection popup to choose current API [yellow]Ctrl+r[white]: start/stop recording from your microphone (needs stt server or whisper binary) @@ -98,6 +96,7 @@ var ( [yellow]Alt+8[white]: show char img or last picked img [yellow]Alt+9[white]: warm up (load) selected llama.cpp model [yellow]Alt+t[white]: toggle thinking blocks visibility (collapse/expand <think> blocks) +[yellow]Alt+c[white]: show colorscheme selection popup === scrolling chat window (some keys similar to vim) === [yellow]arrows up/down and j/k[white]: scroll up and down @@ -109,6 +108,13 @@ var ( === tables (chat history, agent pick, file pick, properties) === [yellow]x[white]: to exit the table page +=== filepicker === +[yellow]c[white]: (in file picker) set current dir as CodingDir +[yellow]x[white]: to exit + +=== shell mode === + [yellow]@match->Tab[white]: file completion with relative paths (recursive, depth 3, max 50 files) + === status line === %s @@ -129,20 +135,20 @@ Press <Enter> or 'x' to return ContrastSecondaryTextColor: tcell.ColorLime, }, "gruvbox": tview.Theme{ - PrimitiveBackgroundColor: tcell.ColorBlack, // Matches #1e1e2e - ContrastBackgroundColor: tcell.ColorDarkGoldenrod, // Selected option: warm yellow (#b57614) - MoreContrastBackgroundColor: tcell.ColorDarkSlateGray, // Non-selected options: dark grayish-blue (#32302f) - BorderColor: tcell.ColorLightGray, // Light gray (#a89984) - TitleColor: tcell.ColorRed, // Red (#fb4934) - GraphicsColor: tcell.ColorDarkCyan, // Cyan (#689d6a) - PrimaryTextColor: tcell.ColorLightGray, // Light gray (#d5c4a1) - SecondaryTextColor: tcell.ColorYellow, // Yellow (#fabd2f) - TertiaryTextColor: tcell.ColorOrange, // Orange (#fe8019) - InverseTextColor: tcell.ColorWhite, // White (#f9f5d7) for selected text - ContrastSecondaryTextColor: tcell.ColorLightGreen, // Light green (#b8bb26) + PrimitiveBackgroundColor: tcell.NewHexColor(0x282828), // Background: #282828 (dark gray) + ContrastBackgroundColor: tcell.ColorDarkGoldenrod, // Selected option: warm yellow (#b57614) + MoreContrastBackgroundColor: tcell.ColorDarkSlateGray, // Non-selected options: dark grayish-blue (#32302f) + BorderColor: tcell.ColorLightGray, // Light gray (#a89984) + TitleColor: tcell.ColorRed, // Red (#fb4934) + GraphicsColor: tcell.ColorDarkCyan, // Cyan (#689d6a) + PrimaryTextColor: tcell.ColorLightGray, // Light gray (#d5c4a1) + SecondaryTextColor: tcell.ColorYellow, // Yellow (#fabd2f) + TertiaryTextColor: tcell.ColorOrange, // Orange (#fe8019) + InverseTextColor: tcell.ColorWhite, // White (#f9f5d7) for selected text + ContrastSecondaryTextColor: tcell.ColorLightGreen, // Light green (#b8bb26) }, "solarized": tview.Theme{ - PrimitiveBackgroundColor: tcell.NewHexColor(0x1e1e2e), // #1e1e2e for main dropdown box + PrimitiveBackgroundColor: tcell.NewHexColor(0x002b36), // Background: #002b36 (base03) ContrastBackgroundColor: tcell.ColorDarkCyan, // Selected option: cyan (#2aa198) MoreContrastBackgroundColor: tcell.ColorDarkSlateGray, // Non-selected options: dark blue (#073642) BorderColor: tcell.ColorLightBlue, // Light blue (#839496) @@ -155,7 +161,7 @@ Press <Enter> or 'x' to return ContrastSecondaryTextColor: tcell.ColorLightCyan, // Light cyan (#93a1a1) }, "dracula": tview.Theme{ - PrimitiveBackgroundColor: tcell.NewHexColor(0x1e1e2e), // #1e1e2e for main dropdown box + PrimitiveBackgroundColor: tcell.NewHexColor(0x282a36), // Background: #282a36 ContrastBackgroundColor: tcell.ColorDarkMagenta, // Selected option: magenta (#bd93f9) MoreContrastBackgroundColor: tcell.ColorDarkGray, // Non-selected options: dark gray (#44475a) BorderColor: tcell.ColorLightGray, // Light gray (#f8f8f2) @@ -179,10 +185,33 @@ func init() { textArea.SetBorder(true).SetTitle("input") // Add input capture for @ completion textArea.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey { - if shellMode && event.Key() == tcell.KeyRune && event.Rune() == '@' { - showFileCompletionPopup("") + if !shellMode { return event } + // Handle Tab key for file completion + if event.Key() == tcell.KeyTab { + currentText := textArea.GetText() + row, col, _, _ := textArea.GetCursor() + // Calculate absolute position from row/col + lines := strings.Split(currentText, "\n") + cursorPos := 0 + for i := 0; i < row && i < len(lines); i++ { + cursorPos += len(lines[i]) + 1 // +1 for newline + } + cursorPos += col + // Look backwards from cursor to find @ + if cursorPos > 0 { + // Find the last @ before cursor + textBeforeCursor := currentText[:cursorPos] + atIndex := strings.LastIndex(textBeforeCursor, "@") + if atIndex >= 0 { + // Extract the partial match text after @ + filter := textBeforeCursor[atIndex+1:] + showFileCompletionPopup(filter) + return nil // Consume the Tab event + } + } + } return event }) textView = tview.NewTextView(). @@ -532,6 +561,10 @@ func init() { } return nil } + if event.Key() == tcell.KeyRune && event.Rune() == 'i' && event.Modifiers()&tcell.ModAlt != 0 { + showColorschemeSelectionPopup() + return nil + } if event.Key() == tcell.KeyF1 { // chatList, err := loadHistoryChats() chatList, err := store.GetChatByChar(cfg.AssistantRole) |
