mirror of
https://github.com/awizemann/scarf.git
synced 2026-05-10 10:36:35 +00:00
dbaadb8037
Introduces a new Projects section that renders custom dashboards from JSON files in project directories. Supports 7 widget types (stat, progress, text, table, chart, list) with live file-watching refresh. Includes project registry, SwiftUI Charts integration, schema docs, and comprehensive README documentation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
47 lines
1.4 KiB
Swift
47 lines
1.4 KiB
Swift
import Foundation
|
|
|
|
enum SidebarSection: String, CaseIterable, Identifiable {
|
|
case dashboard = "Dashboard"
|
|
case insights = "Insights"
|
|
case sessions = "Sessions"
|
|
case activity = "Activity"
|
|
case projects = "Projects"
|
|
case chat = "Chat"
|
|
case memory = "Memory"
|
|
case skills = "Skills"
|
|
case tools = "Tools"
|
|
case gateway = "Gateway"
|
|
case cron = "Cron"
|
|
case health = "Health"
|
|
case logs = "Logs"
|
|
case settings = "Settings"
|
|
|
|
var id: String { rawValue }
|
|
|
|
var icon: String {
|
|
switch self {
|
|
case .dashboard: return "gauge.with.dots.needle.33percent"
|
|
case .insights: return "chart.bar"
|
|
case .sessions: return "bubble.left.and.bubble.right"
|
|
case .activity: return "bolt.horizontal"
|
|
case .projects: return "square.grid.2x2"
|
|
case .chat: return "text.bubble"
|
|
case .memory: return "brain"
|
|
case .skills: return "lightbulb"
|
|
case .tools: return "wrench.and.screwdriver"
|
|
case .gateway: return "antenna.radiowaves.left.and.right"
|
|
case .cron: return "clock.arrow.2.circlepath"
|
|
case .health: return "stethoscope"
|
|
case .logs: return "doc.text"
|
|
case .settings: return "gearshape"
|
|
}
|
|
}
|
|
}
|
|
|
|
@Observable
|
|
final class AppCoordinator {
|
|
var selectedSection: SidebarSection = .dashboard
|
|
var selectedSessionId: String?
|
|
var selectedProjectName: String?
|
|
}
|