diff options
| author | T <t@tjp.lol> | 2026-02-19 22:24:55 -0700 |
|---|---|---|
| committer | T <t@tjp.lol> | 2026-02-19 22:25:26 -0700 |
| commit | b53c952fc8a054d935d90db2ccf3f0b897e6c771 (patch) | |
| tree | bd67d2281c33f48bb2e3c5f743f14153a2dc148c /internal/tui/keys.go | |
| parent | 2ad5e85c729b4a32c4c49584e076ac9f6ce6fa60 (diff) | |
contractor bar across the top
Diffstat (limited to 'internal/tui/keys.go')
| -rw-r--r-- | internal/tui/keys.go | 17 |
1 files changed, 12 insertions, 5 deletions
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: |
