Documentation
¶
Overview ¶
Package app is the root Bubble Tea model for the squad TUI. It composes three sub-views — sidebar (left), focused-run panel (right), and a polymorphic bottom pane (default: composer) — under a single status indicator. The model owns selection, dimensions, and the animation frame; sub-views handle their own internal state.
Index ¶
- func MockRuns() []sidebar.Run
- type App
- func (a App) Init() tea.Cmd
- func (a App) Quitting() bool
- func (a App) Selected() string
- func (a App) Size() (int, int)
- func (a App) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (a App) View() string
- func (a App) WithAgents(names []string) App
- func (a App) WithPresets(store *presets.Store) App
- func (a App) WithProviderToken(token string) App
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is the root model. It holds either a static list of runs (mock / test mode) or a set of disk-backed tailers, but not both. The renderer derives the sidebar list from whichever source is populated.
func AsApp ¶
AsApp narrows a tea.Model back to App. Kept in production code so the per-file go-critic runner can resolve the type — test files alone cannot reference sibling-file types under gocritic's caseOrder check.
func New ¶
New returns an App rendering a static list of runs (no disk I/O). Use this for tests and demos.
func NewWithSessions ¶
NewWithSessions returns an App that auto-discovers + tails the session directories under sessionsRoot (typically ".squad/sessions"). Missing root is not an error — the app renders empty until sessions appear. workingDir is the directory in which launched subprocesses are spawned.
func (App) Selected ¶
Selected returns the currently-selected run's session ID, or "" if no run is selected.
func (App) Size ¶
Size returns the current (width, height) from the most recent WindowSizeMsg, or (0, 0) before the first resize.
func (App) View ¶
View renders the full screen.
Layout:
╭── SQUAD ──────────────────────────────────────────────────╮ │ RUNS FOCUSED │ │ WORKING (3) session id ... │ │ ▶ go-review metrics, events, errors │ │ ... │ │ ✻ Working · go-review · 3m 12s esc to interrupt │ ╰───────────────────────────────────────────────────────────╯ toast message (if any) > type a prompt, /command, !shell, or @file …
The panel is padded vertically to fill (height - toast - composer), so the chrome reaches the bottom of the terminal instead of leaving dead black space below.
func (App) WithAgents ¶
WithAgents seeds the discovered-agents list shown in the launch form typeahead. Order is preserved; callers should pass already-sorted names.
func (App) WithPresets ¶
WithPresets attaches a presets store. Returns the receiver so calls chain cleanly with the constructors.
func (App) WithProviderToken ¶
WithProviderToken seeds the resolved config provider.token used by the launch form's API-key readiness check.