Mission defaults (provider, model, budgets, thinking, effort) and provider base URLs move from the project document to LumaAppState. Opening a project on another machine no longer drags in someone else's model choice or localhost URL. The dialog loads models asynchronously, shows loading and error states inside a stable "Model" row, debounces typed API keys with a length floor, and persists the key on the first successful fetch. Base URL field surfaces only for providers that opt in via capability (local). Reasoning effort dropdown surfaces for Claude Code; the extended-thinking toggle is hidden when the provider doesn't support it.
35 lines
1.2 KiB
Swift
35 lines
1.2 KiB
Swift
import Foundation
|
|
import GRDB
|
|
|
|
public struct ProjectUIState: Codable, Equatable, Identifiable, Sendable, FetchableRecord, PersistableRecord {
|
|
public static let databaseTableName = "project_ui_state"
|
|
|
|
public var id: UUID
|
|
public var selectedItemJSON: String?
|
|
public var isEventStreamCollapsed: Bool
|
|
public var eventStreamBottomHeight: Double
|
|
public var isCollaborationPanelVisible: Bool
|
|
|
|
enum CodingKeys: String, CodingKey {
|
|
case id
|
|
case selectedItemJSON = "selected_item_json"
|
|
case isEventStreamCollapsed = "event_stream_collapsed"
|
|
case eventStreamBottomHeight = "event_stream_bottom_height"
|
|
case isCollaborationPanelVisible = "collaboration_panel_visible"
|
|
}
|
|
|
|
public init(
|
|
id: UUID = UUID(),
|
|
selectedItemJSON: String? = nil,
|
|
isEventStreamCollapsed: Bool = true,
|
|
eventStreamBottomHeight: Double = 0,
|
|
isCollaborationPanelVisible: Bool = false
|
|
) {
|
|
self.id = id
|
|
self.selectedItemJSON = selectedItemJSON
|
|
self.isEventStreamCollapsed = isEventStreamCollapsed
|
|
self.eventStreamBottomHeight = eventStreamBottomHeight
|
|
self.isCollaborationPanelVisible = isCollaborationPanelVisible
|
|
}
|
|
}
|