mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-13 05:16:29 +02:00
SwiftUI app (iOS 17+) with zero third-party dependencies: - Passwordless email authentication with Keychain token storage - Workspace selection and multi-workspace support - Issue list grouped by status with search and filtering - Issue detail with inline status/priority/assignee editing - Comments with threaded display and compose - Agent task runs history and real-time execution log streaming - WebSocket integration for live updates
39 lines
1.2 KiB
Swift
39 lines
1.2 KiB
Swift
import SwiftUI
|
|
|
|
struct ContentView: View {
|
|
@State private var authVM = AuthViewModel()
|
|
@State private var workspaceVM = WorkspaceViewModel()
|
|
@State private var issueListVM = IssueListViewModel()
|
|
|
|
var body: some View {
|
|
Group {
|
|
if !authVM.isAuthenticated {
|
|
LoginView(viewModel: authVM)
|
|
} else if !workspaceVM.hasSelectedWorkspace {
|
|
WorkspacePickerView(viewModel: workspaceVM)
|
|
} else {
|
|
IssueListView(viewModel: issueListVM, workspaceVM: workspaceVM)
|
|
}
|
|
}
|
|
.onReceive(NotificationCenter.default.publisher(for: .logout)) { _ in
|
|
authVM.logout()
|
|
workspaceVM.selectedWorkspace = nil
|
|
issueListVM.issues = []
|
|
}
|
|
.onChange(of: workspaceVM.hasSelectedWorkspace) { _, hasWorkspace in
|
|
if hasWorkspace {
|
|
Task { await issueListVM.loadIssues() }
|
|
setupRealtimeSync()
|
|
}
|
|
}
|
|
}
|
|
|
|
private func setupRealtimeSync() {
|
|
WebSocketClient.shared.onPrefix("issue") { _ in
|
|
Task { @MainActor in
|
|
await issueListVM.refresh()
|
|
}
|
|
}
|
|
}
|
|
}
|