import HelderCore import SwiftUI /// `[ console ] artisan`: the last runs of `helder:schema`, following the newest line; the chevron hides it until the next run. struct SchemaConsolePanel: View { let store: SchemaStore var body: some View { VStack(spacing: 0) { HStack(spacing: 12) { Text("[ console ] artisan").typeRole(Typography.panelLabel).foregroundStyle(Palette.text4).fixedSize() Spacer(minLength: 0) SchemaIconButton(icon: .chevronDown, tip: "Hide console") { store.hideConsole() } } .padding(.leading, 16) .padding(.trailing, 12) .frame(height: SchemaViewMetrics.consoleHeader) ConsoleLogView(entries: store.lines.map { ConsoleLogLine(id: $0.id, text: $0.line.text, color: Palette.artisan($0.line.kind)) }) .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .top) .padding(.horizontal, 16) .padding(.bottom, 12) } .frame(height: SchemaViewMetrics.console) .background(Palette.panel) .hairline(.top) } }