Skip to content

Commit 9a4785b

Browse files
committed
avoid circ dep
1 parent 9000831 commit 9a4785b

File tree

5 files changed

+486
-175
lines changed

5 files changed

+486
-175
lines changed

app/app.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package app
22

33
import (
4+
"claude-squad/app/controller"
45
"claude-squad/app/model"
56
"context"
67

@@ -11,8 +12,17 @@ const GlobalInstanceLimit = 10
1112

1213
// Run is the main entrypoint into the application.
1314
func Run(ctx context.Context, program string, autoYes bool) error {
15+
// Create model first
16+
m := model.NewModel(ctx, program, autoYes)
17+
18+
// Create controller
19+
c := controller.NewController(m.GetSpinner(), m.GetAutoYes())
20+
21+
// Inject controller into model to break circular dependency
22+
m.SetController(c)
23+
1424
p := tea.NewProgram(
15-
model.NewModel(ctx, program, autoYes),
25+
m,
1626
tea.WithAltScreen(),
1727
tea.WithMouseCellMotion(), // Mouse scroll
1828
)

0 commit comments

Comments
 (0)