model

package
v0.21.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CollapseState

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

collapseState is the modern viewport's thinking-fold state: a global default over every committed entry plus per-entry overrides of that default. Because the modern buffer re-renders from the committed transcript each frame, a change here is RETROACTIVE — an already-built entry re-folds to match the new state on the next frame (design §Collapse / expand). It is held BY VALUE inside the model, so its override map is cloned on write (mirroring transcriptModel.recordLoopLive/loopLive): a collapseState copied into a model copy never mutates the other's map.

func NewCollapseState

func NewCollapseState() CollapseState

newCollapseState returns the initial state: globalCollapsed true (thinking starts folded) and no per-entry overrides.

func (CollapseState) Effective

func (c CollapseState) Effective(id DisplayID) bool

Effective reports whether entry id renders COLLAPSED: its per-entry override when one is present, else the global default. It is a value receiver (read-only) — the render path calls it per entry every frame — and is nil-map safe (a missing key reads the global).

func (CollapseState) GloballyCollapsed

func (c CollapseState) GloballyCollapsed() bool

GloballyCollapsed reports the default applied to entries without an override.

func (*CollapseState) Toggle

func (c *CollapseState) Toggle(id DisplayID)

Toggle flips exactly entry id relative to its CURRENT effective state and records the result as a per-entry override (a header click on that entry). The override map is cloned on write (value-copy contract) so a state copied into a model copy never mutates the other's overrides. It is a pointer receiver.

func (*CollapseState) ToggleAll

func (c *CollapseState) ToggleAll()

ToggleAll flips the global default AND clears every per-entry override, so the global toggle (ctrl+t) is authoritative and retroactive: an entry previously toggled open re-follows the new global. Clearing REPLACES the map field with nil rather than mutating it in place, so a state copied into a model copy never observes the change through a shared backing map (clone-on-write). It is a pointer receiver (matching the viewportModel mutator seam convention).

type CompactionProjection

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

compactionProjection is the pure, per-session view of compaction activity. Values are immutable: ApplyEvent clones only the map it changes, so live delivery and restore folding can share the same reducer without retaining aliases to prior states.

func (CompactionProjection) ApplyEvent

ApplyEvent folds compaction lifecycle events. Starts activate their loop unless the same attempt is terminal; terminals tombstone their exact pair and clear only a matching start.

func (CompactionProjection) IsActive

func (p CompactionProjection) IsActive(loopID uuid.UUID) bool

IsActive reports whether loopID currently has a non-terminal compaction attempt.

func (CompactionProjection) IsTerminal

func (p CompactionProjection) IsTerminal(loopID uuid.UUID, attemptID event.CompactAttemptID) bool

IsTerminal reports whether the attempt has already reached a durable terminal event.

type DisplayID

type DisplayID uint64

DisplayID is the stable identity of one rendered transcript entry.

Jump to

Keyboard shortcuts

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