native macOS codings agent orchestrator
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add native split-view main interface

khoi 6d2b1097 ea0c6bd4

+82 -15
+81 -4
supacode/ContentView.swift
··· 8 8 import SwiftUI 9 9 10 10 struct ContentView: View { 11 - let runtime: GhosttyRuntime 11 + @State private var filter = "" 12 + 13 + var body: some View { 14 + NavigationSplitView { 15 + SidebarView(filter: $filter) 16 + } detail: { 17 + EmptyStateView() 18 + .navigationTitle("Supacode") 19 + .toolbar { 20 + ToolbarItemGroup(placement: .primaryAction) { 21 + Button(action: {}) { 22 + Image(systemName: "sidebar.left") 23 + } 24 + Button(action: {}) { 25 + Image(systemName: "square.and.pencil") 26 + } 27 + Button(action: {}) { 28 + Image(systemName: "gearshape") 29 + } 30 + } 31 + } 32 + } 33 + .navigationSplitViewStyle(.balanced) 34 + } 35 + } 36 + 37 + private struct SidebarView: View { 38 + @Binding var filter: String 39 + 40 + var body: some View { 41 + VStack(spacing: 0) { 42 + List { 43 + Section("Projects") { 44 + ProjectRow(name: "suparepo", detail: "main") 45 + } 46 + } 47 + .listStyle(.sidebar) 48 + Divider() 49 + HStack(spacing: 8) { 50 + Button(action: {}) { 51 + Image(systemName: "plus") 52 + } 53 + .buttonStyle(.borderless) 54 + TextField("Filter", text: $filter) 55 + .textFieldStyle(.roundedBorder) 56 + } 57 + .padding(8) 58 + .background(Color(nsColor: .windowBackgroundColor)) 59 + } 60 + .frame(minWidth: 220) 61 + } 62 + } 63 + 64 + private struct ProjectRow: View { 65 + let name: String 66 + let detail: String 12 67 13 68 var body: some View { 14 - GhosttyTerminalView(runtime: runtime) 15 - .frame(maxWidth: .infinity, maxHeight: .infinity) 16 - .background(Color.black) 69 + VStack(alignment: .leading, spacing: 2) { 70 + Text(name) 71 + Text(detail) 72 + .font(.caption) 73 + .foregroundStyle(.secondary) 74 + } 75 + .padding(.vertical, 4) 76 + } 77 + } 78 + 79 + private struct EmptyStateView: View { 80 + var body: some View { 81 + VStack(spacing: 10) { 82 + Image(systemName: "tray") 83 + .font(.title2) 84 + Text("Open a project or worktree") 85 + .font(.headline) 86 + Text("Double-click an item in the sidebar, or press Cmd+O.") 87 + .font(.subheadline) 88 + .foregroundStyle(.secondary) 89 + Button("Open...") {} 90 + } 91 + .frame(maxWidth: .infinity, maxHeight: .infinity) 92 + .background(Color(nsColor: .windowBackgroundColor)) 93 + .multilineTextAlignment(.center) 17 94 } 18 95 }
+1 -11
supacode/supacodeApp.swift
··· 6 6 // 7 7 8 8 import SwiftUI 9 - import GhosttyKit 10 9 11 10 @main 12 11 struct supacodeApp: App { 13 - @StateObject private var ghostty: GhosttyRuntime 14 - 15 - init() { 16 - if ghostty_init(UInt(CommandLine.argc), CommandLine.unsafeArgv) != GHOSTTY_SUCCESS { 17 - preconditionFailure("ghostty_init failed") 18 - } 19 - _ghostty = StateObject(wrappedValue: GhosttyRuntime()) 20 - } 21 - 22 12 var body: some Scene { 23 13 WindowGroup { 24 - ContentView(runtime: ghostty) 14 + ContentView() 25 15 } 26 16 } 27 17 }