refactor: edit existing tui elements to add new gh add tui component

This commit is contained in:
Slug-Boi
2025-04-10 22:31:34 +02:00
parent 4dd972c355
commit 53fef652b1
2 changed files with 36 additions and 0 deletions
+9
View File
@@ -47,6 +47,7 @@ type listKeyMap struct {
createAuthor key.Binding
deleteAuthor key.Binding
tempAdd key.Binding
ghAdd key.Binding
}
func newListKeyMap() *listKeyMap {
@@ -79,6 +80,10 @@ func newListKeyMap() *listKeyMap {
key.WithKeys("T"),
key.WithHelp("T", "Add temporary author"),
),
ghAdd: key.NewBinding(
key.WithKeys("c"),
key.WithHelp("c", "Add GitHub author"),
),
}
}
@@ -180,6 +185,10 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}
// Handle keys from keyList (help menu)
switch {
case key.Matches(msg, m.keys.ghAdd):
sub_model = NewGitHubUserForm(&m)
return m, tea.ClearScreen
case key.Matches(msg, m.keys.negation):
i, ok := m.list.SelectedItem().(item)
if ok {