Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/prog/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2270,7 +2270,7 @@ Press q to quit.`,
}
defer func() { _ = database.Close() }()

return tui.Run(database)
return tui.Run(database, flagProject)
},
}

Expand Down
7 changes: 4 additions & 3 deletions internal/tui/tui.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func statusIcon(s model.Status) string {
}

// New creates a new TUI model with the given database connection.
func New(database *db.DB) Model {
func New(database *db.DB, project string) Model {
// Default: show draft, open, in_progress, blocked, reviewing
statuses := map[model.Status]bool{
model.StatusDraft: true,
Expand All @@ -180,6 +180,7 @@ func New(database *db.DB) Model {
db: database,
viewMode: ViewList,
filterStatuses: statuses,
filterProject: project,
}
}

Expand Down Expand Up @@ -1293,8 +1294,8 @@ func (m Model) detailViewWithHeight(width, height int) string {
}

// Run starts the TUI.
func Run(database *db.DB) error {
m := New(database)
func Run(database *db.DB, project string) error {
m := New(database, project)
p := tea.NewProgram(m, tea.WithAltScreen())
_, err := p.Run()
return err
Expand Down
Loading