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/app.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'internal/tui/app.go') diff --git a/internal/tui/app.go b/internal/tui/app.go index 34310bd..433a5ad 100644 --- a/internal/tui/app.go +++ b/internal/tui/app.go @@ -153,6 +153,12 @@ func (m AppModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { m.historyBox.changeSelection(msg.Forward) } + case selectionToEnd: + switch m.selectedBox { + case HistoryBox: + m.historyBox.changeSelectionToEnd(msg.Top) + } + case drillDownMsg: if m.selectedBox == HistoryBox { m.historyBox.drillDown() @@ -176,7 +182,7 @@ func (m AppModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { case openDeleteConfirmation: if m.selectedBox == HistoryBox && m.historyBox.viewLevel == HistoryLevelDetails { - m.modalBox.activate(ModalTypeDeleteConfirmation, m.historyBox.selectedEntry().ID) + m.modalBox.activate(ModalTypeDeleteConfirmation, m.historyBox.selectedEntry().ID, m) } case recheckBounds: @@ -186,7 +192,7 @@ func (m AppModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { } case openCreateClientModal: - m.modalBox.activate(ModalTypeClient, 0) + m.modalBox.activate(ModalTypeClient, 0, m) m.modalBox.form.fields[0].Focus() case openCreateProjectModal: @@ -205,7 +211,7 @@ func (m AppModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { } func (m *AppModel) openEntryEditor() { - m.modalBox.activate(ModalTypeEntry, m.historyBox.selectedEntry().ID) + m.modalBox.activate(ModalTypeEntry, m.historyBox.selectedEntry().ID, *m) m.modalBox.form.fields[0].Focus() entry := m.historyBox.selectedEntry() @@ -236,7 +242,7 @@ func (m *AppModel) openEntryEditor() { } func (m *AppModel) openHistoryFilterModal() { - m.modalBox.activate(ModalTypeHistoryFilter, 0) + m.modalBox.activate(ModalTypeHistoryFilter, 0, *m) m.modalBox.form.fields[0].Focus() // Pre-populate form with current filter values -- cgit v1.2.3