diff options
author | T <t@tjp.lol> | 2025-08-13 14:47:24 -0600 |
---|---|---|
committer | T <t@tjp.lol> | 2025-08-13 14:47:55 -0600 |
commit | d6781f3e5b431057c23b2deaa943f273699e37f5 (patch) | |
tree | 269ef61bc44750881068ebd94d643a9b3a57c20c /internal/tui/history_box.go | |
parent | 389b72e55b04ccfc02b04eb81cb8f7bb7a5c8b59 (diff) |
client and project modal field suggestions, ctrl+n to accept
Diffstat (limited to 'internal/tui/history_box.go')
-rw-r--r-- | internal/tui/history_box.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/internal/tui/history_box.go b/internal/tui/history_box.go index c5c045e..01ea59b 100644 --- a/internal/tui/history_box.go +++ b/internal/tui/history_box.go @@ -401,6 +401,15 @@ func (m *HistoryBoxModel) changeSelection(forward bool) { } } +func (m *HistoryBoxModel) changeSelectionToEnd(top bool) { + switch m.viewLevel { + case HistoryLevelSummary: + m.changeSummarySelectionToEnd(top) + case HistoryLevelDetails: + m.changeDetailsSelectionToEnd(top) + } +} + func (m *HistoryBoxModel) changeSummarySelection(forward bool) { newIdx := m.summarySelection if forward { @@ -416,6 +425,14 @@ func (m *HistoryBoxModel) changeSummarySelection(forward bool) { } } +func (m *HistoryBoxModel) changeSummarySelectionToEnd(top bool) { + if top { + m.summarySelection = 0 + } else { + m.summarySelection = len(m.summaryItems) - 1 + } +} + func (m *HistoryBoxModel) changeDetailsSelection(forward bool) { newIdx := m.detailSelection entries := m.selectedEntries() @@ -432,6 +449,14 @@ func (m *HistoryBoxModel) changeDetailsSelection(forward bool) { } } +func (m *HistoryBoxModel) changeDetailsSelectionToEnd(top bool) { + if top { + m.detailSelection = 0 + } else { + m.detailSelection = len(m.selectedEntries()) - 1 + } +} + func (m HistoryBoxModel) selectedEntry() queries.TimeEntry { if m.viewLevel != HistoryLevelDetails { panic("fetching selected entry in history summary level") |