Documentation
¶
Overview ¶
Package cardeditor implements the direct-store create and edit overlay.
Index ¶
- func IsMessage(message tea.Msg) bool
- type Model
- func (m Model) BrandMounted() bool
- func (m *Model) CancelAsync()
- func (m *Model) ConsumeSaved() (string, bool)
- func (m Model) Dirty() bool
- func (m Model) Enabled() bool
- func (m Model) IsOpen() bool
- func (m *Model) MouseHandler(width, height int) func(tea.MouseMsg) tea.Cmd
- func (m *Model) OpenAdd(status board.Status) tea.Cmd
- func (m *Model) OpenEdit(task board.Task) tea.Cmd
- func (m *Model) Overlay(background string, width, height int) string
- func (m Model) PointerSession() uint64
- func (m *Model) PointerSurface(width, height int) pointer.Surface
- func (m *Model) Refresh(task board.Task, found bool) tea.Cmd
- func (m *Model) Resize(width, height int)
- func (m *Model) SetAIRunner(runner SkillRunner, ctx context.Context)
- func (m *Model) SetFrontMost(front bool) tea.Cmd
- func (m *Model) SetProjectDefault(name string)
- func (m *Model) SetStyles(styles *theme.Styles)
- func (m Model) TaskID() string
- func (m Model) TerminalSelectionActive() bool
- func (m Model) TerminalSelectionView(width, height int) string
- func (m *Model) Update(message tea.Msg) tea.Cmd
- func (m *Model) View(width, height int) string
- type SkillRunner
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model owns every mutable editor field and all asynchronous generations.
func New ¶
New creates a closed editor. A nil store keeps the feature unavailable in lightweight root-model tests.
func (Model) BrandMounted ¶
BrandMounted reports whether the editor's branded engine is ticking.
func (*Model) CancelAsync ¶
func (m *Model) CancelAsync()
CancelAsync stops work whose result no longer has a live program to receive it. It is used by the root shutdown path and is otherwise idempotent.
func (*Model) ConsumeSaved ¶
ConsumeSaved reports one acknowledged mutation and its durable task id to the root exactly once.
func (Model) Dirty ¶
Dirty reports whether the current fields differ from the last store-backed snapshot. Returning to the original values disarms the close guard.
func (*Model) MouseHandler ¶
MouseHandler maps clicks in the rendered editor to symbolic control targets. The root model can install this callback while the editor owns the screen; the resulting message is routed through Update just like a key press.
func (*Model) Overlay ¶
Overlay composes the editor over the board/detail surface. Spec section 4: the panel is an elevation over what is behind it, never a frame, so it takes the shade step and the shadow with it.
func (Model) PointerSession ¶
PointerSession identifies this open editor owner across harmless renders.
func (*Model) PointerSurface ¶
PointerSurface publishes the rendered handler together with its immutable stable-control topology for root-level stale-generation admission.
func (*Model) Refresh ¶
Refresh adopts an external store snapshot only while the form is clean. Dirty input remains authoritative and receives a scoped stale warning.
func (*Model) Resize ¶ added in v1.7.3
Resize keeps terminal-native snapshot navigation aligned with the latest root dimensions even while the ordinary overlay renderer is bypassed.
func (*Model) SetAIRunner ¶
func (m *Model) SetAIRunner(runner SkillRunner, ctx context.Context)
SetAIRunner wires the shared runner and the root program context. A nil runner hides the draft controls while leaving ordinary editing available.
func (*Model) SetFrontMost ¶
SetFrontMost is the background handoff of spec section 10.2.6. At most spin.MaxEngines branded engines tick at once and the one that does belongs to the front-most open surface, so a backgrounded editor stops its engine - the draft keeps running, only the animation stops - and remounts at step 0 when it comes back to front.
func (*Model) SetProjectDefault ¶
SetProjectDefault hands the editor the project a new card belongs to. The board keeps it current as the switcher moves; an open form is left alone, because the project on screen is the one the user is editing.
func (*Model) SetStyles ¶
SetStyles hands the editor the resolved design system. Spec section 6.2: the root builds it once per terminal background and threads it down; the editor never constructs one per frame.
func (Model) TerminalSelectionActive ¶ added in v1.7.3
func (Model) TerminalSelectionView ¶ added in v1.7.3
type SkillRunner ¶
type SkillRunner interface {
RunSkill(context.Context, string, ai.Scope, string, string, int, int64) (ai.RunResult, error)
}
SkillRunner is the shared direct-store AI runner used by the editor. The narrow interface keeps model tests deterministic.
type Store ¶
type Store interface {
AddTask(string, board.Task) (board.Task, error)
UpdateTaskIfFieldsMatch(string, string, store.TaskPatch, store.TaskPatch) (board.Task, error)
Labels(string) ([]string, error)
SearchSimilar(string, string, string, []string, int) ([]store.SimilarHit, error)
}
Store is the direct SQLite projection used by the editor. It deliberately mirrors the store package instead of introducing another adapter.