Raw
1 import SwiftUI
2
3 @main
4 struct ControlKitRunnerApp: App {
5 // MARK: - Internal
6
7 var body: some Scene {
8 WindowGroup {
9 ControlKitShowcaseView()
10 }
11 .defaultSize(width: 820, height: 620)
12 }
13 }
14
15 private struct ControlKitShowcaseView: View {
16 // MARK: - Internal
17
18 var body: some View {
19 ScrollView {
20 VStack(alignment: .leading, spacing: 28) {
21 HStack(spacing: 18) {
22 logo
23 VStack(alignment: .leading, spacing: 4) {
24 Text("ControlKit")
25 .font(.system(size: 40, weight: .bold, design: .rounded))
26 Text("Apple platform automation")
27 .font(.title3)
28 .foregroundStyle(.secondary)
29 }
30 }
31
32 Text("A clean-room runner for reliable black-box testing across Apple platforms.")
33 .font(.title2.weight(.medium))
34 .fixedSize(horizontal: false, vertical: true)
35
36 statusCard
37 informationCard
38
39 Link(destination: repositoryURL) {
40 Label("View project on GitHub", systemImage: "arrow.up.right")
41 .font(.headline)
42 .frame(maxWidth: .infinity)
43 }
44 .buttonStyle(.borderedProminent)
45 }
46 .padding(40)
47 .frame(maxWidth: 760, alignment: .leading)
48 }
49 }
50
51 // MARK: - Private
52
53 private let repositoryURL = URL(string: "https://github.com/ondeinference/xcrs-controlkit")!
54
55 private var logo: some View {
56 Text("XC\nRS")
57 .font(.system(size: 30, weight: .black, design: .rounded))
58 .multilineTextAlignment(.center)
59 .lineSpacing(-8)
60 .foregroundStyle(Color.controlKitGreen)
61 .frame(width: 96, height: 96)
62 .background(Color.controlKitCream, in: RoundedRectangle(cornerRadius: 24))
63 }
64
65 private var statusCard: some View {
66 VStack(alignment: .leading, spacing: 14) {
67 Label("Runner online", systemImage: "checkmark.circle.fill")
68 .font(.headline)
69 .foregroundStyle(.green)
70 Text("The XCTest host is ready to receive ControlKit automation requests.")
71 .foregroundStyle(.secondary)
72 }
73 .padding(22)
74 .frame(maxWidth: .infinity, alignment: .leading)
75 .background(.thinMaterial, in: RoundedRectangle(cornerRadius: 20))
76 }
77
78 private var informationCard: some View {
79 VStack(alignment: .leading, spacing: 16) {
80 infoRow(title: "Project", value: "XCRSControlKit")
81 infoRow(title: "Creator", value: "smbCloud")
82 infoRow(title: "Platform", value: "visionOS")
83 infoRow(title: "Purpose", value: "Native spatial automation runner")
84 }
85 .padding(22)
86 .frame(maxWidth: .infinity, alignment: .leading)
87 .background(.thinMaterial, in: RoundedRectangle(cornerRadius: 20))
88 }
89
90 private func infoRow(title: String, value: String) -> some View {
91 HStack {
92 Text(title)
93 .foregroundStyle(.secondary)
94 Spacer()
95 Text(value)
96 .fontWeight(.semibold)
97 }
98 }
99 }
100
101 private extension Color {
102 static let controlKitGreen = Color(red: 0.106, green: 0.263, blue: 0.196)
103 static let controlKitCream = Color(red: 0.961, green: 0.953, blue: 0.925)
104 }