Documentation
¶
Overview ¶
Package app is lp's top-level tea.Model — the low-profile root. It stays thin: a focus stack, layout math, and message dispatch live here; the transcript, overlays, and slash panel are reused from pkg/ui/bubbletea/components re-themed black + gold, while the status line, input, and panels are lp's own. There is deliberately no banner and no thinking sprite.
Index ¶
- func AllTodosCompleted(store *todo.TodoStore) bool
- func RenderDaemons(ds *daemon.DaemonState, _ int, th *theme.Theme) string
- func RenderTasksDoneSnapshot(store *todo.TodoStore, width int, th *theme.Theme) string
- func RenderTodos(store *todo.TodoStore, width int, th *theme.Theme) string
- type App
- type FocusStack
- type Focusable
- type Input
- type StatusLine
- type SubmitMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllTodosCompleted ¶
AllTodosCompleted reports whether the store holds at least one todo and every one is completed — the trigger for the auto-fold snapshot. Inlined here so lp doesn't import the bubbletea todos strip at all.
func RenderDaemons ¶
RenderDaemons renders a one-line summary of the active background daemons (subagents, bash tasks, monitors, lsp), grouped by kind. Returns "" when none are running or the state is nil. Terminal daemons (EndedAt set) are omitted — they're about to be evicted.
func RenderTasksDoneSnapshot ¶
RenderTasksDoneSnapshot is the synthetic transcript block appended when every todo completes (just before the store is cleared): a sage header and the finished list, so the scrollback keeps a record of what was done.
func RenderTodos ¶
RenderTodos renders lp's compact task panel: a gold "tasks" header and one row per todo with lp's own restrained glyphs (· pending, ▸ active, ✓ done). Returns "" when empty. lp owns this rather than reusing the bubbletea todos strip so its glyphs stay gold/sage instead of falling back to the theme's (nil) private glyph map.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is lp's root model.
func New ¶
New builds a fresh App with the given (black + gold) theme. The program reference is wired afterwards via SetProgram.
func (*App) Attach ¶
func (a *App) Attach(c ui.Controller)
Attach hands the model the agent controller and primes the status line.
func (*App) SetProgram ¶
SetProgram hands the model the program reference used by run goroutines to dispatch RunDoneMsg back to the main loop.
func (*App) View ¶
View composes the frame top→bottom (each chrome layer is fixed height; the transcript flexes; panels/overlay collapse when empty):
status line ─ rule ─ transcript viewport todos panel (when tracked) daemon line (when running) overlay | slash (when open / typing "/") ─ rule ─ input hint
type FocusStack ¶
type FocusStack struct {
// contains filtered or unexported fields
}
FocusStack is the ordered modal stack. The topmost Focusable consumes key events; lower ones are visible but inert.
func (*FocusStack) Pop ¶
func (f *FocusStack) Pop() Focusable
Pop removes and returns the top, or nil if empty.
func (*FocusStack) Push ¶
func (f *FocusStack) Push(x Focusable)
Push installs x as the new top. Nil is a no-op.
func (*FocusStack) Top ¶
func (f *FocusStack) Top() Focusable
Top returns the topmost Focusable without popping, or nil when empty.
type Focusable ¶
type Focusable interface {
Update(msg tea.Msg) (close bool, cmd tea.Cmd)
View(width int, th *theme.Theme) string
Key() string
Modal() bool
Hint() string
}
Focusable is the contract every modal overlay implements. lp pushes one onto FocusStack when the user opens a panel and pops when Update reports close==true.
The method set matches the bubbletea overlays exactly (same imported theme.Theme type), so lp reuses those overlays — they satisfy this interface structurally without any adapter.
type Input ¶
type Input struct {
// contains filtered or unexported fields
}
Input is a thin bubbles/textarea wrapper owning lp's command-line look: a gold ❯ prompt, a gold cursor, a single slim row, and prompt history. The underline frame is applied by the theme's InputBorder at View time.
func NewInput ¶
NewInput builds the input. Gold is read off the theme (UserPrompt's foreground) so the palette stays in one place — lp/theme.go.
func (*Input) SetWidth ¶
SetWidth updates the textarea's visible column count, reserving columns for the underline frame's padding.
type StatusLine ¶
type StatusLine struct {
// contains filtered or unexported fields
}
StatusLine is lp's slim top instrument line: brand · state · model · cwd on the left, tokens · context · mode on the right, padded to width. It reuses the bubbletea run-state machine (status.State) and the public spinner frames, but renders its own low-profile gold layout — no diamonds, no bottom HUD. Accent colors are read off the theme's exported style fields so the palette stays in lp/theme.go.
func NewStatusLine ¶
func NewStatusLine(state *status.State) *StatusLine
NewStatusLine binds the line to lp's run-state machine and captures the working directory once at construction.
func (*StatusLine) Render ¶
func (s *StatusLine) Render(width int, th *theme.Theme) string
Render composes the one-line HUD, padded to width. When the terminal is too narrow for the right cluster, only the left cluster is shown.
func (*StatusLine) SetContext ¶
func (s *StatusLine) SetContext(used, limit int)
func (*StatusLine) SetEffort ¶
func (s *StatusLine) SetEffort(e string)
func (*StatusLine) SetModel ¶
func (s *StatusLine) SetModel(m string)
func (*StatusLine) SetPermissionMode ¶
func (s *StatusLine) SetPermissionMode(m string)
func (*StatusLine) SetUsage ¶
func (s *StatusLine) SetUsage(u llm.Usage)