Repository navigation
feat(robot_simulation): show createPythonCSE's code in the tab's editor - #989
Merged
Merged
Conversation
createPythonCSE now sends its program text to the RobotSimulation tab, which shows it in the embedded editor (overwriting any text restored from localStorage), so the editor shows what is running. The module replays the latest text to a tab that connects after setup. Running code from the embedded editor now replaces the createPythonCSE program instead of driving the robot alongside it. Closes #988 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
With createPythonCSE running its code on init_simulation and showing it in the tab's editor, run_robot_code (the repl-module hook) is a second way to do the same thing. Code is now run either via createPythonCSE or from the tab's embedded editor. $focusTab was only ever sent from run_robot_code. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Member
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0d8299a295
ℹ️ 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".
A robot runs one program at a time. Tracking only the latest createPythonCSE Program meant an earlier one kept running next to editor code. A second call now throws instead. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #988.
What changed
createPythonCSE(code)now also sendscodeto the RobotSimulation tab over the state channel (neweditor-codemessage). The embedded editor shows it, overwriting whatever it held, including text restored fromlocalStorage.request-replay, so a tab that connects after setup ran still gets it.$runReplCode) now stops thecreatePythonCSEprogram, so the editor shows what is running instead of a second program driving the robot alongside it.createPythonCSEkeeps its name and call shape:addControllerToWorld(createPythonCSE(CODE), world).createPythonCSEmay only be called once per simulation; a second call throws. (Addresses the Codex review.)run_robot_code(therepl-module hook) and the now-unused$focusTabRPC are removed, so there is one way to run robot code:createPythonCSE(runs oninit_simulation, shown in the editor) or the tab's embedded editor. Breaking:set_evaluator(run_robot_code)no longer works.Testing
robot_simulationtests: 135 pass, including 5 new ones (message sent, replay on reconnect, second call rejected, nothing sent before a program exists, editor Run stops the setup program).tscpasses. ESLint is unchanged from master for the touched directories.useEffectthat copies the pushed text into the editor and alocalStoragewrite.yarn buildcurrently fails on master as well, with an acorn SyntaxError, so I couldn't build it. The tab'stscreports errors that come from the missing bundle build output.🤖 Generated with Claude Code