adrsplit

package
v1.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

Package adrsplit implements the direct-runner ADR-to-stories review overlay.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsMessage

func IsMessage(message tea.Msg) bool

IsMessage identifies overlay-owned asynchronous results.

Types

type Model

type Model struct {
	// contains filtered or unexported fields
}

Model owns the source, asynchronous split, review edits, and sequential batch write. Every result is scoped to both the overlay session and its operation generation so a cancelled or reopened dialog cannot be mutated.

func New

func New(st Store, runner Runner, user string, ctx context.Context) Model

New creates a closed overlay. Nil dependencies keep the feature unavailable in lightweight root-model tests.

func (Model) BrandMounted

func (m Model) BrandMounted() bool

BrandMounted reports whether this overlay's branded engine is ticking.

func (*Model) Close

func (m *Model) Close()

Close force-closes the overlay and cancels any in-flight read or AI run. A batch write already handed to SQLite is not cancellable; its completion is safely ignored after the session advances.

func (*Model) ConsumeChanged

func (m *Model) ConsumeChanged() bool

ConsumeChanged reports durable creations to the root exactly once.

func (Model) Enabled

func (m Model) Enabled() bool

Enabled reports whether both the shared runner and direct store are wired.

func (Model) IsOpen

func (m Model) IsOpen() bool

IsOpen reports whether this overlay owns user input and rendering.

func (*Model) MouseHandler

func (m *Model) MouseHandler(width, height int) func(tea.MouseMsg) tea.Cmd

MouseHandler returns a release-only immutable map derived from the current rendered frame. Updating the model remains the caller's responsibility.

func (*Model) Open

func (m *Model) Open() tea.Cmd

Open starts a new isolated overlay session.

func (*Model) Overlay

func (m *Model) Overlay(background string, width, height int) string

Overlay composes the split review over the current 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

func (m Model) PointerSession() uint64

PointerSession identifies this open ADR owner across harmless renders.

func (*Model) PointerSurface

func (m *Model) PointerSurface(width, height int) pointer.Surface

PointerSurface publishes the rendered handler together with its immutable stable-control topology for root-level stale-generation admission.

func (*Model) SetDataDir

func (m *Model) SetDataDir(dir string)

SetDataDir names the directory the active project is resolved from — the one holding the board and its state.json. Empty falls back to $KB_DATA and the default data directory, the same as every other surface.

func (*Model) SetFrontMost

func (m *Model) SetFrontMost(front bool) tea.Cmd

SetFrontMost is the background handoff of spec section 10.2.6: a surface that is not front-most stops its engine and remounts at step 0 on return.

func (*Model) SetStyles

func (m *Model) SetStyles(styles *theme.Styles)

SetStyles hands the overlay the resolved design system. Spec section 6.2: styles are built once by the root and threaded down, never constructed here.

func (*Model) Update

func (m *Model) Update(message tea.Msg) tea.Cmd

Update applies user input and scoped asynchronous results.

func (*Model) View

func (m *Model) View(width, height int) string

View renders the overlay without its board background.

type Runner

type Runner interface {
	RunSkill(context.Context, string, ai.Scope, string, string, int, int64) (ai.RunResult, error)
}

Runner is the shared direct-store AI runner. The narrow interface keeps the overlay testable without another transport.

type Store

type Store interface {
	AddTask(string, board.Task) (board.Task, error)
}

Store is the one direct SQLite write the review step needs.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL