Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ struct LocalEndpoint: Identifiable, Equatable {
url.appendingPathComponent("dashboard")
}

var openWorldsURL: URL {
url.appendingPathComponent("openworlds")
}

var monitorURL: URL {
url.appendingPathComponent("monitor")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ final class AppProcessService: ObservableObject {
try throwAndRecord("Could not find a free viewer port near \(preferredPort).")
}
let baseURL = URL(string: "http://127.0.0.1:\(port)")!
let dashboard = baseURL.appendingPathComponent("dashboard")
var env: [String: String] = [:]
if !stateDir.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
env["CLAWDND_STATE_DIR"] = (stateDir as NSString).expandingTildeInPath
Expand All @@ -86,14 +85,15 @@ final class AppProcessService: ObservableObject {
)
viewerProcess = managed
activeCampaignID = campaignID
viewerEndpoint = LocalEndpoint(
let endpoint = LocalEndpoint(
name: "Viewer",
url: baseURL,
healthPath: "/state",
status: .running
)
append("Started viewer pid \(managed.pid) on \(dashboard.absoluteString)", stream: .supervisor)
return dashboard
viewerEndpoint = endpoint
append("Started viewer pid \(managed.pid) on \(endpoint.openWorldsURL.absoluteString)", stream: .supervisor)
return endpoint.openWorldsURL
}

func stopViewer() {
Expand Down Expand Up @@ -177,15 +177,15 @@ final class AppProcessService: ObservableObject {
providerProcess = managed
runningProvider = kind
let baseURL = URL(string: "http://127.0.0.1:\(port)")!
let dashboard = baseURL.appendingPathComponent("dashboard")
viewerEndpoint = LocalEndpoint(
let endpoint = LocalEndpoint(
name: "Provider viewer",
url: baseURL,
healthPath: "/state",
status: .starting
)
viewerEndpoint = endpoint
append("\(request.message) pid \(managed.pid)", stream: .provider)
return dashboard
return endpoint.openWorldsURL
}

func stopProvider() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct CampaignsView: View {
CampaignRow(campaign: campaign)
.tag(campaign.id)
.contextMenu {
Button("Open in Dashboard") {
Button("Open in Play Surface") {
open(campaign)
}
}
Expand Down
4 changes: 2 additions & 2 deletions macos/ClawDnDApp/Sources/ClawDnDApp/Views/MonitorView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ struct MonitorView: View {
private func openMonitor() {
do {
webViewErrorMessage = nil
let dashboard = try processService.startViewer(
let surface = try processService.startViewer(
repoPath: repoPath,
preferredPort: preferredPort,
stateDir: stateDir
)
webURL = processService.viewerEndpoint?.monitorURL
?? dashboard.deletingLastPathComponent().appendingPathComponent("monitor")
?? surface.deletingLastPathComponent().appendingPathComponent("monitor")
} catch {
alertMessage = error.localizedDescription
}
Expand Down
2 changes: 1 addition & 1 deletion macos/ClawDnDApp/Sources/ClawDnDApp/Views/PlayView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ struct PlayView: View {
Button {
startViewer()
} label: {
Label("Open Dashboard", systemImage: "rectangle.on.rectangle")
Label("Open Play Surface", systemImage: "rectangle.on.rectangle")
}
Button {
startProvider()
Expand Down
4 changes: 2 additions & 2 deletions macos/ClawDnDApp/Sources/ClawDnDApp/Views/WebView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct WebView: NSViewRepresentable {
private func report(_ error: Error) {
let nsError = error as NSError
guard nsError.domain != NSURLErrorDomain || nsError.code != NSURLErrorCancelled else { return }
navigationError.wrappedValue = "Dashboard failed to load: \(error.localizedDescription)"
navigationError.wrappedValue = "Surface failed to load: \(error.localizedDescription)"
}
}
}
Expand All @@ -62,7 +62,7 @@ struct WebViewErrorView: View {
Image(systemName: "exclamationmark.triangle")
.font(.system(size: 42, weight: .regular))
.foregroundStyle(.orange)
Text("Dashboard Unavailable")
Text("Surface Unavailable")
.font(.title3.weight(.semibold))
Text(message)
.font(.callout)
Expand Down
Loading