restores Helder in all its glory

This commit is contained in:
2026-09-28 11:34:49 +02:00
parent c2b38b853c
commit 1d29d0952d
280 changed files with 29205 additions and 7 deletions
@@ -0,0 +1,33 @@
import AppKit
import SwiftUI
/// The root view of one window: owns the WorkspaceModel and wires it to the NSWindow and the menus.
public struct WorkspaceWindow: View {
@State private var model: WorkspaceModel
public init(root: URL?) {
_model = State(initialValue: WorkspaceModel(root: root, app: .live))
}
public var body: some View {
WorkspaceView(model: model)
.frame(minWidth: Metrics.minimumWindow.width, minHeight: Metrics.minimumWindow.height)
.background(Palette.editor)
.background(WindowBridge(model: model, title: model.title, hasProject: model.root != nil))
.preferredColorScheme(.dark)
.focusedSceneValue(\.workspace, model)
.task { await model.start() }
}
}
struct WorkspaceFocusKey: FocusedValueKey {
typealias Value = WorkspaceModel
}
extension FocusedValues {
/// The key window's workspace, for menu commands.
var workspace: WorkspaceModel? {
get { self[WorkspaceFocusKey.self] }
set { self[WorkspaceFocusKey.self] = newValue }
}
}