Documentation
¶
Overview ¶
Package watch implements the chunk watch TUI dashboard.
Index ¶
- type Draft
- type Drafter
- type Model
- func (m Model) Init() tea.Cmd
- func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m Model) View() tea.View
- func (m Model) WithBottomMargin(rows int) Model
- func (m Model) WithConnection(conn chunkd.Connection) Model
- func (m Model) WithDrafts(ctx context.Context, dir string, draft Drafter, send Sender) Model
- func (m Model) WithRelaunch() Model
- type ProjectEntry
- type Sender
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Draft ¶ added in v0.7.217
Draft is Claude's draft of a change, made on the developer's machine in a factory run's worktree: the run, what Claude said it did, and the diff it left, summarized per file and in full. Stat is "" when it changed nothing.
type Drafter ¶ added in v0.7.217
Drafter has Claude draft prompt in the project at root, reporting what it does to activity. It returns the draft as far as it got, with an error, when drafting fails or ctx is cancelled. Errors are shown as typed, so they should read as a sentence.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the BubbleTea model for the watch dashboard.
func New ¶
func New(projects []ProjectEntry, watchAll bool) Model
New creates a Model ready to run. When watchAll is true (the default for `chunk watch`; `--focus` turns it off), each poll also checks for projects that have started a run since the dashboard started and adds them, so a run started after the dashboard launches still shows up without a restart.
func (Model) WithBottomMargin ¶ added in v0.7.217
WithBottomMargin returns a copy of m that leaves the terminal's last rows blank. Editors' built-in terminals can report a row or two more than they show, and the rows they hide are the footer's.
func (Model) WithConnection ¶ added in v0.7.196
func (m Model) WithConnection(conn chunkd.Connection) Model
WithConnection returns a copy of m that reports conn as the daemon it talks to. New reads it from the environment; this is for callers and tests that already know.
func (Model) WithDrafts ¶ added in v0.7.217
WithDrafts returns a copy of m on which n opens a prompt for Claude to draft with draft, and the draft can be sent to the factory with send. Drafts are in dir's project, the one the dashboard was opened in, or the selected run's when dir is "". Drafting stops when ctx is cancelled.
func (Model) WithRelaunch ¶ added in v0.7.204
WithRelaunch returns a copy of m that starts the daemon again when a poll finds it gone.
type ProjectEntry ¶
type ProjectEntry struct {
ProjectRoot string
}
ProjectEntry holds everything the watch model needs for one project.