Phase 7 of the monorepo maintainability plan: New files created: - model/jobs.go - Job type, JobStatus constants, list.Item interface - model/messages.go - tea.Msg types (JobsLoadedMsg, StatusMsg, TickMsg, etc.) - model/styles.go - NewJobListDelegate(), JobListTitleStyle(), SpinnerStyle() - model/keys.go - KeyMap struct, DefaultKeys() function Modified files: - model/state.go - reduced from 226 to ~130 lines - Removed: Job, JobStatus, KeyMap, Keys, inline styles - Kept: State struct, domain re-exports, ViewMode, DatasetInfo, InitialState() - controller/commands.go - use model. prefix for message types - controller/controller.go - use model. prefix for message types - controller/settings.go - use model.SettingsContentMsg Deleted files: - controller/keys.go (moved to model/keys.go since State references KeyMap) Result: - No file >150 lines in model/ package - Single concern per file: state, jobs, messages, styles, keys - All 41 test packages pass
37 lines
897 B
Go
37 lines
897 B
Go
// Package model provides TUI data structures and state management
|
|
package model
|
|
|
|
import "time"
|
|
|
|
// JobsLoadedMsg contains loaded jobs from the queue
|
|
type JobsLoadedMsg []Job
|
|
|
|
// TasksLoadedMsg contains loaded tasks from the queue
|
|
type TasksLoadedMsg []*Task
|
|
|
|
// GpuLoadedMsg contains GPU status information
|
|
type GpuLoadedMsg string
|
|
|
|
// ContainerLoadedMsg contains container status information
|
|
type ContainerLoadedMsg string
|
|
|
|
// LogLoadedMsg contains log content
|
|
type LogLoadedMsg string
|
|
|
|
// QueueLoadedMsg contains queue status information
|
|
type QueueLoadedMsg string
|
|
|
|
// SettingsContentMsg contains settings content
|
|
type SettingsContentMsg string
|
|
|
|
// SettingsUpdateMsg indicates settings should be updated
|
|
type SettingsUpdateMsg struct{}
|
|
|
|
// StatusMsg contains status text and level
|
|
type StatusMsg struct {
|
|
Text string
|
|
Level string
|
|
}
|
|
|
|
// TickMsg represents a timer tick
|
|
type TickMsg time.Time
|