refactor services to use Interface and change name to app

This commit is contained in:
Robin Olsen
2026-02-22 16:16:09 +01:00
parent dbf619a054
commit 118e67dbf4
36 changed files with 247 additions and 219 deletions

View File

@@ -9,7 +9,7 @@ import (
tea "github.com/charmbracelet/bubbletea"
)
type TUIConfig = service.Config
type Config = service.Config
type Tui struct {
feedbackChan chan task.ValidationFeedback
@@ -20,15 +20,15 @@ func NewTui() *Tui {
return &Tui{}
}
func (t *Tui) Run(ctx context.Context, config TUIConfig) error {
svc, cleanup, err := service.NewServices(ctx, config)
func (t *Tui) Run(ctx context.Context, config Config) error {
app, cleanup, err := service.NewServices(ctx, config)
if err != nil {
return err
}
defer cleanup()
p := tea.NewProgram(views.NewDashboardView(svc, t.feedbackChan, t.quitChan),
p := tea.NewProgram(views.NewDashboardView(app, t.feedbackChan, t.quitChan),
tea.WithAltScreen(), tea.WithMouseAllMotion())
if t.quitChan != nil {