Skip to content

feat(macos): open OpenWorlds play surface - #126

Merged
100yenadmin merged 1 commit into
mainfrom
macos/openworlds-webview-route
May 25, 2026
Merged

feat(macos): open OpenWorlds play surface#126
100yenadmin merged 1 commit into
mainfrom
macos/openworlds-webview-route

Conversation

@100yenadmin

@100yenadmin 100yenadmin commented May 25, 2026

Copy link
Copy Markdown
Member

Summary

This is the stacked PR C from the OpenWorlds fidelity rollout. It changes the native macOS shell to open the viewer-hosted OpenWorlds play surface in WKWebView instead of defaulting Play/Campaign launches to the legacy dashboard route.

  • Adds LocalEndpoint.openWorldsURL.
  • Makes AppProcessService.startViewer(...) return /openworlds.
  • Makes AppProcessService.startProviderSession(...) return /openworlds.
  • Keeps LocalEndpoint.dashboardURL available as the fallback/debug route.
  • Keeps Monitor routed to /monitor.
  • Renames visible generic dashboard error/copy in the app to “surface” so the UI is not tied to the old route.

Stacked on #125 because /openworlds/ is introduced there. Refs #82, #113, #114.

Architecture Boundary

SwiftUI remains the native supervisor/control center:

  • starts and stops the local viewer/provider processes;
  • chooses ports and records endpoint status;
  • hosts the existing browser surface in WKWebView;
  • exposes logs/errors/diagnostics.

The macOS app does not become a game-state writer. Game-state authority remains in the engine and the browser write lane remains the existing /move player-intent endpoint. This PR only changes which same-origin viewer route the app loads after launch.

Route Behavior

  • Play -> startViewer(...) -> http://127.0.0.1:<port>/openworlds
  • Start Game/provider -> startProviderSession(...) -> http://127.0.0.1:<port>/openworlds
  • Campaign Browser open -> startViewer(... campaignID:) -> http://127.0.0.1:<port>/openworlds
  • Monitor -> viewerEndpoint.monitorURL -> http://127.0.0.1:<port>/monitor
  • Debug/fallback dashboard remains available through LocalEndpoint.dashboardURL.

Validation

Local validation from /Volumes/LEXAR/repos/ClawDnD-openworlds-webview-route:

  • swift build --package-path macos/ClawDnDApp
  • ./script/build_and_run.sh --verify
  • python3 -m py_compile viewer/server.py
  • python3 -m unittest viewer.tests.test_openworlds_static -q
  • python3 scripts/license_check.py
  • git diff --check

The verify command launched dist/ClawDnD.app; I stopped the launched app process afterward and confirmed no dist/ or build artifacts are staged.

Review Notes

This PR is intentionally narrow. It does not add new SwiftUI game screens, rewrite the OpenWorlds UI, change provider contracts, or touch engine/rules/voice/story/QA lanes.

Summary by CodeRabbit

  • New Features

    • Added support for a dedicated "Open Worlds" surface URL for viewer/provider flows.
  • Style

    • Rebranded UI terminology: "Dashboard" renamed to "Play Surface" (buttons, menus, views, and error headers) for consistent user-facing language.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 25, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b51ce268-d4c1-4145-9f2b-4a7a9528723b

📥 Commits

Reviewing files that changed from the base of the PR and between f4fe9ec and d754c3a.

📒 Files selected for processing (6)
  • macos/ClawDnDApp/Sources/ClawDnDApp/Models/LocalEndpoint.swift
  • macos/ClawDnDApp/Sources/ClawDnDApp/Services/AppProcessService.swift
  • macos/ClawDnDApp/Sources/ClawDnDApp/Views/CampaignsView.swift
  • macos/ClawDnDApp/Sources/ClawDnDApp/Views/MonitorView.swift
  • macos/ClawDnDApp/Sources/ClawDnDApp/Views/PlayView.swift
  • macos/ClawDnDApp/Sources/ClawDnDApp/Views/WebView.swift
📜 Recent review details
🧰 Additional context used
🧬 Code graph analysis (2)
macos/ClawDnDApp/Sources/ClawDnDApp/Views/MonitorView.swift (1)
macos/ClawDnDApp/Sources/ClawDnDApp/Services/AppProcessService.swift (1)
  • startViewer (53-97)
macos/ClawDnDApp/Sources/ClawDnDApp/Services/AppProcessService.swift (1)
macos/ClawDnDApp/Sources/ClawDnDApp/Views/PlayView.swift (1)
  • startViewer (129-140)
🔇 Additional comments (7)
macos/ClawDnDApp/Sources/ClawDnDApp/Models/LocalEndpoint.swift (1)

25-27: LGTM!

macos/ClawDnDApp/Sources/ClawDnDApp/Services/AppProcessService.swift (2)

88-96: LGTM!


180-188: LGTM!

macos/ClawDnDApp/Sources/ClawDnDApp/Views/CampaignsView.swift (1)

42-42: LGTM!

macos/ClawDnDApp/Sources/ClawDnDApp/Views/MonitorView.swift (1)

53-53: LGTM!

Also applies to: 59-59

macos/ClawDnDApp/Sources/ClawDnDApp/Views/PlayView.swift (1)

67-67: LGTM!

macos/ClawDnDApp/Sources/ClawDnDApp/Views/WebView.swift (1)

51-51: LGTM!

Also applies to: 65-65


📝 Walkthrough

Walkthrough

The PR replaces dashboard terminology with Play Surface/openworlds: adds LocalEndpoint.openWorldsURL, uses it in AppProcessService viewer/provider startup and logs, and updates view labels and WebView error text to Surface / Play Surface.

Changes

Dashboard to Play Surface Terminology Update

Layer / File(s) Summary
openWorldsURL endpoint property
macos/ClawDnDApp/Sources/ClawDnDApp/Models/LocalEndpoint.swift
LocalEndpoint adds a computed openWorldsURL property that derives the openworlds surface URL by appending "openworlds" to the endpoint's base url.
Service viewer and provider startup
macos/ClawDnDApp/Sources/ClawDnDApp/Services/AppProcessService.swift
startViewer() and startProviderSession() now construct LocalEndpoint instances, store them in viewerEndpoint, log using openWorldsURL, and return that URL instead of building separate dashboard paths.
UI label and error message updates
macos/ClawDnDApp/Sources/ClawDnDApp/Views/CampaignsView.swift, MonitorView.swift, PlayView.swift, WebView.swift
Button labels update from "Open in Dashboard" / "Open Dashboard" to "Open in Play Surface" / "Open Play Surface"; error messages and titles change from Dashboard/Dashboard Unavailable to Surface/Surface Unavailable; variable naming shifts from dashboard to surface.

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues:

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding support for the OpenWorlds play surface as the new route for viewer launches, replacing the legacy dashboard route.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • LINEAR integration encountered authorization issues. Please disconnect and reconnect the integration in the CodeRabbit UI.

Comment @coderabbitai help to get the list of available commands and usage tips.

@100yenadmin

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 25, 2026

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@100yenadmin
100yenadmin force-pushed the macos/openworlds-webview-route branch 2 times, most recently from 233ef64 to e1061f2 Compare May 25, 2026 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant