Documentation
¶
Overview ¶
Package ui is the Control Tower's presentation layer (P6). It renders the read-only app.TowerView and drives a pure state machine over it. Per the ui↛store law (T2), this package imports ONLY the app facade (the TowerView data + the re-observe action) and contract — never store/kernel/runtime. The Model is pure: it holds no *Runtime and performs no writes; a re-observe surfaces as an INTENT that the command layer executes (against a fresh view — the concurrency re-check).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ReobserveIntent ¶
ReobserveIntent is the Model's request for the COMMAND layer to perform the side-effecting write. The Model never writes; the command executes app.ReobserveCandidate against a freshly-built view.
type TowerAction ¶
type TowerAction int
TowerAction is a state-machine input. The Tower offers ONLY these; the Model enforces legality (T4) — an action illegal in the current state is a pure no-op, never an out-of-bounds or a forbidden write.
const ( ActionNextPage TowerAction = iota ActionPrevPage ActionCursorDown ActionCursorUp ActionReobserve // INBOX only: re-observe the selected escalation (returns an intent) ActionDismiss // INBOX only: read-side acknowledge the selected escalation (no kernel write) )
type TowerModel ¶
type TowerModel struct {
// contains filtered or unexported fields
}
TowerModel is the pure state machine over a TowerView snapshot: the active page, the INBOX cursor, and the read-side-dismissed escalations. All transitions are pure (no shared mutation, no I/O).
func NewTowerModel ¶
func NewTowerModel(view app.TowerView) TowerModel
NewTowerModel seeds a model on the GOAL page from a freshly-built view.
func (TowerModel) Page ¶
func (m TowerModel) Page() TowerPage
Page reports the active page (for the command/tests).
func (TowerModel) Render ¶
func (m TowerModel) Render() string
Render draws the active page beneath a tab bar naming all four pages (so every page title is always present — the headless --dump acceptance). It is a pure read of the snapshot.
func (TowerModel) RenderAll ¶
func (m TowerModel) RenderAll() string
RenderAll draws every page body (the full --dump snapshot — four pages, all titles + content).
func (TowerModel) Update ¶
func (m TowerModel) Update(a TowerAction) (TowerModel, *ReobserveIntent)
Update applies an action and returns the next model plus an optional re-observe intent (only when a legal ActionReobserve fires on a selectable, re-observable escalation). Illegal actions are pure no-ops (T4): a cursor move off an empty/non-INBOX page does nothing; a re-observe off INBOX yields no intent.
func (TowerModel) WithView ¶
func (m TowerModel) WithView(view app.TowerView) TowerModel
WithView returns a copy refreshed to a newly-built view (the command rebuilds each tick), preserving the page + dismissals and clamping the cursor to the new open-escalation list.