From b53c952fc8a054d935d90db2ccf3f0b897e6c771 Mon Sep 17 00:00:00 2001 From: T Date: Thu, 19 Feb 2026 22:24:55 -0700 Subject: contractor bar across the top --- internal/tui/keys.go | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'internal/tui/keys.go') diff --git a/internal/tui/keys.go b/internal/tui/keys.go index c0c5605..775cccc 100644 --- a/internal/tui/keys.go +++ b/internal/tui/keys.go @@ -10,6 +10,7 @@ type KeyBindingScope int const ( ScopeGlobal KeyBindingScope = iota + ScopeContractorBox ScopeTimerBox ScopeProjectsBox ScopeHistoryBoxSummaries @@ -57,11 +58,6 @@ var Bindings map[KeyBindingScope]map[string]KeyBinding = map[KeyBindingScope]map Description: func(am AppModel) string { return "Refresh" }, Result: func(am *AppModel) tea.Cmd { return am.refreshCmd }, }, - "c": KeyBinding{ - Key: "c", - Description: func(am AppModel) string { return "Edit Contractor" }, - Result: func(am *AppModel) tea.Cmd { return editContractor() }, - }, "q": KeyBinding{ Key: "q", Description: func(am AppModel) string { return "Quit" }, @@ -80,6 +76,13 @@ var Bindings map[KeyBindingScope]map[string]KeyBinding = map[KeyBindingScope]map Hide: true, }, }, + ScopeContractorBox: { + "e": KeyBinding{ + Key: "e", + Description: func(AppModel) string { return "Edit Contractor" }, + Result: func(am *AppModel) tea.Cmd { return editContractor() }, + }, + }, ScopeTimerBox: { "enter": KeyBinding{ Key: "Enter", @@ -384,6 +387,8 @@ func HandleKeyPress(msg tea.KeyMsg, data *AppModel) tea.Cmd { var local map[string]KeyBinding switch data.selectedBox { + case ContractorBox: + local = Bindings[ScopeContractorBox] case TimerBox: local = Bindings[ScopeTimerBox] case ProjectsBox: @@ -416,6 +421,8 @@ func activeBindings(box BoxType, level HistoryViewLevel, modal ModalBoxModel) [] var scope KeyBindingScope switch box { + case ContractorBox: + scope = ScopeContractorBox case TimerBox: scope = ScopeTimerBox case ProjectsBox: -- cgit v1.2.3