Task 9 — Add Beacon Editor Debug Window (inspect snapshot, validate JSON, simulate evaluation)#10
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 893deca96a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!Application.isPlaying) | ||
| { | ||
| EditorGUILayout.HelpBox("Enter Play Mode to inspect runtime client.", MessageType.Info); | ||
| return; | ||
| } |
There was a problem hiding this comment.
Keep JSON validation available in Edit Mode
OnGUI returns immediately when !Application.isPlaying, which prevents DrawJsonValidationPanel() from ever rendering outside Play Mode even though ValidateJson does not depend on a live BeaconClient. In practice this blocks the offline config-check workflow (pasting raw JSON before running the game), so the new validator is unavailable in a common use case.
Useful? React with 👍 / 👎.
| if (memberValue is IContextProvider contextProvider) | ||
| { | ||
| context = contextProvider.GetContext(); |
There was a problem hiding this comment.
Catch context-provider exceptions during auto-resolve
TryResolveClientAndContextFromSource catches reflection access errors, but contextProvider.GetContext() is called outside that protection. If a selected/auto-found IContextProvider throws (e.g., while runtime state is not ready), the exception will propagate during window repaint or Auto-find and make the debug window fail instead of gracefully skipping that source.
Useful? React with 👍 / 👎.
Motivation
Description
Packages/com.kbanakakis.beacon/Editor/com.kbanakakis.beacon.Editor.asmdefto contain editor-only code referencing the runtime package.BeaconDebugWindowinPackages/com.kbanakakis.beacon/Editor/BeaconDebugWindow.cswith aTools/Beacon/Debug Windowmenu entry, Play Mode guarding, and UI panels for client selection, manualRefreshAsync, snapshot display, context display, JSON validation (usesBasicConfigValidator), flag evaluation (IsEnabled), and typed value reads (GetBool/GetInt/GetFloat/GetString).MonoBehaviourexposing aBeaconClientandIContextProvidervia reflection with try/catch guarding to avoid editor exceptions, and included Unity.metafiles for the new Editor assets.Testing
pythonto confirmPackages/com.kbanakakis.beacon/Editor/com.kbanakakis.beacon.Editor.asmdefis valid JSON, and it passed.Codex Task