ui

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

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

type ReobserveIntent struct {
	Escalation app.InboxRow
}

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

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.

type TowerPage

type TowerPage int

TowerPage is one of the Control Tower's four pages (§3.3 IA).

const (
	PageGoal TowerPage = iota
	PageField
	PageInbox
	PageLedger
)

func (TowerPage) Title

func (p TowerPage) Title() string

Title is the page's sanctioned name (the vocabulary the lint enforces).

Jump to

Keyboard shortcuts

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