sent submission at init to make submission lablel appear

This commit is contained in:
Robin Olsen
2026-03-20 10:47:55 +01:00
parent 977d0e2df0
commit 3e7ab044a6
2 changed files with 19 additions and 2 deletions

View File

@@ -5,7 +5,7 @@ import (
"charm.land/bubbles/v2/textarea"
"charm.land/bubbles/v2/textinput"
"charm.land/bubbletea/v2"
tea "charm.land/bubbletea/v2"
"github.com/LazyBachelor/LazyPM/internal/app"
"github.com/LazyBachelor/LazyPM/internal/models"
"github.com/LazyBachelor/LazyPM/pkg/tui/components"
@@ -193,6 +193,10 @@ func (m *Model) startEditAssignee(selected ListIssue) {
}
func (m *Model) Init() tea.Cmd {
if m.submitChan != nil {
m.submitChan <- struct{}{}
m.logAction("tui submitted validation")
}
return components.ListenForValidation(m.feedbackChan)
}

View File

@@ -5,7 +5,7 @@ import (
"charm.land/bubbles/v2/textarea"
"charm.land/bubbles/v2/textinput"
"charm.land/bubbletea/v2"
tea "charm.land/bubbletea/v2"
"github.com/LazyBachelor/LazyPM/internal/app"
"github.com/LazyBachelor/LazyPM/internal/models"
"github.com/LazyBachelor/LazyPM/pkg/tui/components"
@@ -169,7 +169,20 @@ func (m *Model) startEditAssignee(selected ListIssue) {
m.assigneeInput.CursorEnd()
}
func (m *Model) logAction(action string) {
if m.app != nil {
m.app.LogAction(models.EncodeActionEvent(models.ActionEvent{
Source: "tui",
Action: action,
}))
}
}
func (m *Model) Init() tea.Cmd {
if m.submitChan != nil {
m.submitChan <- struct{}{}
m.logAction("tui submitted validation")
}
return components.ListenForValidation(m.feedbackChan)
}