change tui and status command to use callback.

add keybind to submit
This commit is contained in:
Robin Olsen
2026-03-04 22:44:55 +01:00
parent 4842d30aab
commit cc6c4ea7cb
5 changed files with 49 additions and 28 deletions

View File

@@ -15,6 +15,7 @@ type ValidationFeedback = models.ValidationFeedback
type Tui struct {
feedbackChan chan ValidationFeedback
quitChan chan bool
submitChan chan<- struct{}
}
func New() *Tui {
@@ -29,7 +30,7 @@ func (t *Tui) Run(ctx context.Context, config Config) error {
defer cleanup()
p := tea.NewProgram(views.NewDashboardView(app, t.feedbackChan, t.quitChan),
p := tea.NewProgram(views.NewDashboardView(app, t.feedbackChan, t.quitChan, t.submitChan),
tea.WithAltScreen(), tea.WithMouseAllMotion())
if t.quitChan != nil {
@@ -50,3 +51,7 @@ func (t *Tui) SetChannels(feedbackChan chan ValidationFeedback, quitChan chan bo
t.feedbackChan = feedbackChan
t.quitChan = quitChan
}
func (t *Tui) SetSubmitChan(submitChan chan<- struct{}) {
t.submitChan = submitChan
}