summaryrefslogtreecommitdiff
path: root/internal/tui/keys.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/tui/keys.go')
-rw-r--r--internal/tui/keys.go17
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: