Documentation
¶
Overview ¶
Package carddetail renders the full-card overlay and its direct-store comment and blocker-link actions.
Index ¶
- func IsMutationMessage(message tea.Msg) bool
- type DriftBackend
- type Model
- func (m Model) Armed() bool
- func (m Model) BrandMounted() bool
- func (m *Model) ClearSelection() bool
- func (m *Model) Close()
- func (m *Model) ConsumeChanged() bool
- func (m Model) IsDestructivePrompt() bool
- func (m Model) IsOpen() bool
- func (m Model) MouseHandler(width, height int) func(tea.MouseMsg) tea.Cmd
- func (m *Model) NoticeUnknownTaskRef(seq int)
- func (m *Model) Open(task board.Task) tea.Cmd
- func (m *Model) Overlay(background string, width, height int) string
- func (m Model) OwnsInput() bool
- func (m Model) PointerSession() uint64
- func (m *Model) PointerSurface(background string, width, height int) pointer.Surface
- func (m *Model) Refresh(task board.Task) tea.Cmd
- func (m *Model) Resize(width, height int)
- func (m *Model) ResolvePointerMessage(message tea.Msg) (tea.Msg, bool)
- func (m *Model) SetClock(now func() time.Time)
- func (m *Model) SetDriftBackend(backend DriftBackend, ctx context.Context)
- func (m *Model) SetFrontMost(front bool) tea.Cmd
- 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 OpenTaskRefMsg
- type Reader
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsMutationMessage ¶
IsMutationMessage identifies action results without exposing their concrete message types to the root package.
Types ¶
type DriftBackend ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model owns the overlay's task snapshot, enriched detail, and the bubbles viewport that carries its scroll state.
func New ¶
New creates a closed detail pane. A nil reader still shows board-resident task fields; enrichment is simply unavailable to lightweight model tests.
The styles are the design system of spec section 6: the pane never builds a lipgloss style, it composes the cached ones, and it hands the palette-derived markdown config to glamour through the injectable renderer.
func (Model) Armed ¶
Armed reports whether the pane's destructive prompt has taken its second step. Spec section 1.9 Armed, which is the one state in the TUI that recolors an overlay header band (section 10.1.4, ratified call 6).
func (Model) BrandMounted ¶
BrandMounted reports whether this pane's branded engine is ticking.
func (*Model) ClearSelection ¶ added in v1.7.3
func (*Model) Close ¶
func (m *Model) Close()
Close dismisses the pane and invalidates any in-flight result by clearing the current task identity.
func (*Model) ConsumeChanged ¶
ConsumeChanged reports one acknowledged mutation exactly once.
func (Model) IsDestructivePrompt ¶
IsDestructivePrompt reports whether the overlay is showing a prompt whose affirmative carries the ButtonDanger variant of spec section 5.4. Both steps of the comment and link delete - the Delete arm and the Confirm delete - are the same prompt, so the transition between them does not re-arm the root's destructive-prompt grace (spec section 10.3.3).
func (Model) MouseHandler ¶
MouseHandler routes wheel scrolling within the pane and left-click dismissal outside it. The root disables this handler while nested detail input is active.
func (*Model) NoticeUnknownTaskRef ¶
NoticeUnknownTaskRef reports a reference that addresses no card the board holds. Spec section 10.8.5: nothing was attempted and nothing failed, so this is a notice in the body rather than the pinned failure block, and an unresolvable reference costs the reader one line instead of a dismissed pane.
func (*Model) Overlay ¶
Overlay composes the pane over the board without making carddetail own the board renderer. Input routing remains the root model's responsibility.
func (Model) OwnsInput ¶
OwnsInput is the root-routing seam for text entry, selection, confirmation, and in-flight writes. Destructive or focus-changing root shortcuts must not run while it returns true.
func (Model) PointerSession ¶
PointerSession identifies one open detail owner independently of harmless render generations.
func (*Model) PointerSurface ¶
PointerSurface renders the detail overlay and returns the immutable pointer map produced from this exact layout pass. The root selects it as the active top-most surface, so carddetail never exposes board hit regions while open.
func (*Model) Refresh ¶
Refresh replaces the board-resident snapshot and serializes enrichment IO. Repeated refreshes during a load collapse into one successor for the latest task snapshot.
func (*Model) ResolvePointerMessage ¶
ResolvePointerMessage unwraps a message only while the exact rendered detail session and nested action state are still current. A release queued from an older pane cannot mutate a reopened task or a later confirmation.
func (*Model) SetClock ¶
SetClock injects the wall clock the branded engine's elapsed suffix reads through, so a test can pin the suffix without pinning the frame.
func (*Model) SetDriftBackend ¶
func (m *Model) SetDriftBackend(backend DriftBackend, ctx context.Context)
func (*Model) SetFrontMost ¶
SetFrontMost is the background handoff of spec section 10.2.6: a pane that is not front-most stops its engine and remounts at step 0 on return.
It is also where a newly armed operation mounts, because the root calls it after every routed message. That is one rule instead of two: an engine ticks exactly when its surface is front-most and its gate is open, and no start path has to remember to open a chain of its own.
func (*Model) SetStyles ¶
SetStyles adopts a rebuilt design system. Spec section 6.3: the root resolves the palette again when tea.BackgroundColorMsg answers, and every pane it owns has to follow it or the frame renders two palettes at once.
func (Model) TerminalSelectionActive ¶ added in v1.7.3
func (Model) TerminalSelectionView ¶ added in v1.7.3
type OpenTaskRefMsg ¶
type OpenTaskRefMsg struct{ Seq int }
OpenTaskRefMsg asks the root to open the card a rendered kb://task reference addresses. The pane cannot resolve a sequence number itself: the board is the root's, and so is the card-opening path a click on a board card already takes, so the reference reuses it rather than growing a second one.
It crosses the session guard of ResolvePointerMessage like every other detail pointer message, so a release queued from a pane that has since been reopened on another card opens nothing.
type Reader ¶
type Reader interface {
Comments(user, taskRef string) ([]store.Comment, error)
TaskLinks(user, taskID string) (store.TaskLinks, error)
Tombstone(user, taskID string) (store.Tombstone, bool, error)
}
Reader is the store projection needed to enrich a board task for display.
type Writer ¶
type Writer interface {
AddComment(user, taskRef, author, body string) (store.Comment, error)
DeleteComment(user string, id int) (store.Comment, error)
Link(user, blockerRef, blockedRef string) (blocker, blocked board.Task, err error)
Unlink(user, aRef, bRef string) error
}
Writer is the direct SQLite projection used by detail actions. Reader stays separate so read-only and lightweight callers do not need mutation stubs.