enable editor changes in sketch mode, refactor some of the code manager (#2287)

* Revert "Revert "client side sketch updating properly with direct changes to t… (#2286)"

This reverts commit e7ab645267.

* rejig out side of xstate

* test tweak

* more test tweak

* refactor some codeManager stuff

* tsc

* try and fix tests

* revert small uneeded change

* fix

* snapshot tweak

* more test tweak

* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)

* small tweak

* disable bad test

* fmt

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Kurt Hutten
2024-05-06 19:28:30 +10:00
committed by GitHub
parent 6959036688
commit 43928f88aa
13 changed files with 53 additions and 27 deletions

View File

@ -56,7 +56,7 @@ function OnboardingWithNewFile() {
dismiss={dismiss}
next={() => {
// We do want to update both the state and editor here.
codeManager.updateCodeStateEditor(bracket)
codeManager.updateCodeEditor(bracket)
kclManager.executeCode(true)
next()
}}
@ -80,7 +80,7 @@ function OnboardingWithNewFile() {
dismiss={dismiss}
next={() => {
void createAndOpenNewProject()
codeManager.updateCodeStateEditor(bracket)
codeManager.updateCodeEditor(bracket)
dismiss()
}}
nextText="Make a new project"
@ -113,7 +113,7 @@ export default function Introduction() {
const isStarterCode = currentCode === '' || currentCode === bracket
useEffect(() => {
if (codeManager.code === '') codeManager.updateCodeStateEditor(bracket)
if (codeManager.code === '') codeManager.updateCodeEditor(bracket)
}, [])
return isStarterCode ? (