package monitor import ( "time" "git.davoryn.de/calic/syncwarden/internal/icons" ) // AggregateStatus holds the full aggregated status for the tray. type AggregateStatus struct { State icons.State DevicesTotal int DevicesOnline int DownRate float64 // bytes/sec UpRate float64 // bytes/sec LastSync time.Time Paused bool RecentFiles []RecentFile ConflictCount int Folders []FolderInfo PendingDevices int } // FolderInfo holds per-folder info for the menu. type FolderInfo struct { ID string Label string Path string State string // "idle", "syncing", "scanning", "error", etc. } // RecentFile records a recently synced file. type RecentFile struct { Name string Folder string Timestamp time.Time } // stateFromFolders determines the aggregate icon state from folder states. func stateFromFolders(folders []FolderInfo, paused bool) icons.State { if paused { return icons.StatePaused } hasError := false hasSyncing := false for _, f := range folders { switch f.State { case "error": hasError = true case "syncing", "sync-preparing", "scanning", "sync-waiting", "scan-waiting": hasSyncing = true } } if hasError { return icons.StateError } if hasSyncing { return icons.StateSyncing } return icons.StateIdle }