adds schema view and schema generating command

This commit is contained in:
2026-11-03 09:35:41 +01:00
parent cc41decccb
commit 600d4874d2
62 changed files with 4416 additions and 105 deletions
+12 -4
View File
@@ -2,8 +2,8 @@ import AppKit
import HelderCore
import SwiftUI
/// The launcher without a project; with one, the title bar, three columns and status bar, then the Git view
/// over all of them, overlays above.
/// The launcher without a project; with one, the title bar, three columns and status bar, then the Git or
/// Schema view over all of them, overlays above.
struct WorkspaceView: View {
let model: WorkspaceModel
@@ -37,12 +37,19 @@ struct WorkspaceView: View {
.environment(\.pointerLayer, model.overlay.isPresented ? .workspace : .overlay)
}
}
.overlay {
if model.layout.isSchemaViewOpen, let schema = model.schema {
SchemaView(model: model, store: schema)
.environment(\.pointerLayer, model.overlay.isPresented ? .workspace : .overlay)
}
}
.overlay { OverlayHost(model: model) }
.overlay {
if model.overlay.current == .launcher { RecentProjectsOverlay(model: model).environment(\.pointerLayer, .overlay) }
}
.background(PointerRefresher(trigger: PointerRefresher.Trigger(
overlay: model.overlay.current, gitViewOpen: model.layout.isGitViewOpen, activePath: model.editor?.activePath,
overlay: model.overlay.current, gitViewOpen: model.layout.isGitViewOpen,
schemaViewOpen: model.layout.isSchemaViewOpen, activePath: model.editor?.activePath,
visibility: model.layout.visibility, scale: model.layout.textScale)))
.onAppear { model.layout.windowResized(width: proxy.size.width) }
.onChange(of: proxy.size.width) { _, width in model.layout.windowResized(width: width) }
@@ -147,12 +154,13 @@ private struct HiddenPaneFocusGuard: NSViewRepresentable {
}
}
/// Re-reads the pointer when what lies under a still mouse changes: an overlay, the Git view, the open file,
/// Re-reads the pointer when what lies under a still mouse changes: an overlay, the Git or Schema view, the open file,
/// a column shown or hidden.
private struct PointerRefresher: NSViewRepresentable {
struct Trigger: Equatable {
var overlay: Overlay
var gitViewOpen: Bool
var schemaViewOpen: Bool
var activePath: String?
var visibility: ColumnVisibility
var scale: Double