summaryrefslogtreecommitdiff
path: root/internal/tui/modal.go
diff options
context:
space:
mode:
authorT <t@tjp.lol>2025-08-13 14:47:24 -0600
committerT <t@tjp.lol>2025-08-13 14:47:55 -0600
commitd6781f3e5b431057c23b2deaa943f273699e37f5 (patch)
tree269ef61bc44750881068ebd94d643a9b3a57c20c /internal/tui/modal.go
parent389b72e55b04ccfc02b04eb81cb8f7bb7a5c8b59 (diff)
client and project modal field suggestions, ctrl+n to accept
Diffstat (limited to 'internal/tui/modal.go')
-rw-r--r--internal/tui/modal.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/tui/modal.go b/internal/tui/modal.go
index 8277077..badc658 100644
--- a/internal/tui/modal.go
+++ b/internal/tui/modal.go
@@ -116,7 +116,7 @@ func (m ModalBoxModel) RenderDeleteConfirmation() string {
}
func (m *ModalBoxModel) activateCreateProjectModal(am AppModel) {
- m.activate(ModalTypeProject, 0)
+ m.activate(ModalTypeProject, 0, am)
if am.selectedBox == ProjectsBox && len(am.projectsBox.clients) > 0 {
client := am.projectsBox.clients[am.projectsBox.selectedClient]
m.form.fields[1].SetValue(client.Name)
@@ -124,11 +124,12 @@ func (m *ModalBoxModel) activateCreateProjectModal(am AppModel) {
m.form.fields[0].Focus()
}
-func (m *ModalBoxModel) activate(t ModalType, editedID int64) {
+func (m *ModalBoxModel) activate(t ModalType, editedID int64, am AppModel) {
m.Active = true
m.Type = t
m.form = t.newForm()
m.editedID = editedID
+ m.form.SetSuggestions(am)
}
func (m *ModalBoxModel) deactivate() {