From d6781f3e5b431057c23b2deaa943f273699e37f5 Mon Sep 17 00:00:00 2001 From: T Date: Wed, 13 Aug 2025 14:47:24 -0600 Subject: client and project modal field suggestions, ctrl+n to accept --- internal/tui/keys.go | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'internal/tui/keys.go') diff --git a/internal/tui/keys.go b/internal/tui/keys.go index c2f2271..3a7242d 100644 --- a/internal/tui/keys.go +++ b/internal/tui/keys.go @@ -164,6 +164,16 @@ var Bindings map[KeyBindingScope]map[string]KeyBinding = map[KeyBindingScope]map Description: func(AppModel) string { return "Filter" }, Result: func(*AppModel) tea.Cmd { return createHistoryFilterModal() }, }, + "g": KeyBinding{ + Key: "g", + Description: func(AppModel) string { return "Top" }, + Result: func(*AppModel) tea.Cmd { return changeSelectionToTop() }, + }, + "G": KeyBinding{ + Key: "G", + Description: func(AppModel) string { return "Bottom" }, + Result: func(*AppModel) tea.Cmd { return changeSelectionToBottom() }, + }, }, ScopeHistoryBoxDetails: { "j": KeyBinding{ @@ -214,6 +224,16 @@ var Bindings map[KeyBindingScope]map[string]KeyBinding = map[KeyBindingScope]map Result: func(*AppModel) tea.Cmd { return backToHistorySummary() }, Hide: true, }, + "g": KeyBinding{ + Key: "g", + Description: func(AppModel) string { return "Top" }, + Result: func(*AppModel) tea.Cmd { return changeSelectionToTop() }, + }, + "G": KeyBinding{ + Key: "G", + Description: func(AppModel) string { return "Bottom" }, + Result: func(*AppModel) tea.Cmd { return changeSelectionToBottom() }, + }, }, ScopeModal: { "enter": KeyBinding{ @@ -231,6 +251,23 @@ var Bindings map[KeyBindingScope]map[string]KeyBinding = map[KeyBindingScope]map Description: func(AppModel) string { return "Close" }, Result: func(*AppModel) tea.Cmd { return closeModal() }, }, + "ctrl+n": KeyBinding{ + Key: "Ctrl+n", + Description: func(m AppModel) string { + if m.modalBox.form.fields[m.modalBox.form.selIdx].suggestions == noSuggestions { + return "" + } else { + return "Accept Suggestion" + } + }, + Result: func(m *AppModel) tea.Cmd { + field := &m.modalBox.form.fields[m.modalBox.form.selIdx] + sugg := field.CurrentSuggestion() + field.SetValue(sugg) + field.CursorEnd() + return nil + }, + }, }, } -- cgit v1.2.3