model implements Model
| 111 | |
| 112 | // model implements Model |
| 113 | type model struct { |
| 114 | width int |
| 115 | height int |
| 116 | xPos int // absolute x position on screen |
| 117 | yPos int // absolute y position on screen |
| 118 | layoutCfg LayoutConfig // layout configuration for spacing |
| 119 | sessionUsage map[string]*runtime.Usage // sessionID -> latest usage snapshot |
| 120 | todoComp *todotool.SidebarComponent |
| 121 | ragIndexing map[string]*ragIndexingState // strategy name -> indexing state |
| 122 | spinner spinner.Spinner |
| 123 | spinnerActive bool // true when spinner is registered with animation coordinator |
| 124 | mode Mode |
| 125 | sessionTitle string |
| 126 | sessionStarred bool |
| 127 | sessionHasContent bool // true when session has been used (has messages) |
| 128 | currentAgent string |
| 129 | agentModel string |
| 130 | agentDescription string |
| 131 | availableAgents []runtime.AgentDetails |
| 132 | agentSwitching bool |
| 133 | availableTools int |
| 134 | availableSkills int |
| 135 | toolsLoading bool // true when more tools may still be loading |
| 136 | sessionState *service.SessionState |
| 137 | workingAgent string // Name of the agent currently working (empty if none) |
| 138 | sessionStack []string // Active stream session IDs; the top is the active (deepest) session |
| 139 | rootSessionID string // Main (top-level) session, shown when no stream is active |
| 140 | scrollview *scrollview.Model |
| 141 | workingDirectory string |
| 142 | gitBranchName string // current git branch, empty if not in a repo |
| 143 | queuedMessages []string // Truncated preview of queued messages |
| 144 | streamCancelled bool // true after ESC cancel until next StreamStartedEvent |
| 145 | collapsed bool // true when sidebar is collapsed |
| 146 | titleRegenerating bool // true when title is being regenerated by AI |
| 147 | titleGenerated bool // true once a title has been generated or set (hides pencil until then) |
| 148 | preferredWidth int // user's preferred width (persisted across collapse/expand) |
| 149 | editingTitle bool // true when inline title editing is active |
| 150 | titleInput textinput.Model |
| 151 | lastTitleClickTime time.Time // for double-click detection on title |
| 152 | |
| 153 | ctx func() context.Context |
| 154 | |
| 155 | // Render cache to avoid re-rendering sections on every frame during scroll |
| 156 | cachedLines []string // Cached rendered lines |
| 157 | cachedWidth int // Width used for cached render |
| 158 | cachedNeedsScrollbar bool // Whether scrollbar is needed for cached render |
| 159 | cacheDirty bool // True when cache needs rebuild |
| 160 | layoutDirty bool // True when a change may alter line count/scrollbar visibility (not just an animation frame) |
| 161 | |
| 162 | // Agent click zones: maps content line index to agent name for click detection |
| 163 | agentClickZones map[int]string // content line -> agent name |
| 164 | // agentLineOwners records, per rendered agent-section body line, which agent |
| 165 | // emitted it (empty for blank separators). It is produced during agentInfo |
| 166 | // rendering so click zones can be registered explicitly rather than inferred |
| 167 | // from blank-line heuristics. |
| 168 | agentLineOwners []string |
| 169 | } |
| 170 |
nothing calls this directly
no outgoing calls
no test coverage detected