Reset code on critical onboarding steps (#2727)

* Make sure we always reset the code on important steps no matter what the user did to it

* Convert comments in codeManager to JSDoc comments so they appear in diagnostics

* Was using the wrong codeManager callback

* Make sure editorView is available before resetting code

* Add Playwright test that shows the code being reset

* Fix up text that looks like linksÏ

* fmt

* Skip test on MacOS, make test more reliable on Chrome

* Update cargo-clippy to run based on paths on PRs as well

* playw fix

* try keep reports

* add fix me

* try one last thing

* fmt

---------

Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
This commit is contained in:
Frank Noirot
2024-06-20 21:39:01 -04:00
committed by GitHub
parent a1bcad9dfb
commit 17978ab1d7
11 changed files with 130 additions and 103 deletions

View File

@ -68,7 +68,9 @@ export default class CodeManager {
this._currentFilePath = path
}
// This updates the code state and calls the updateState function.
/**
* This updates the code state and calls the updateState function.
*/
updateCodeState(code: string): void {
if (this._code !== code) {
this.code = code
@ -76,7 +78,9 @@ export default class CodeManager {
}
}
// Update the code in the editor.
/**
* Update the code in the editor.
*/
updateCodeEditor(code: string): void {
this.code = code
if (editorManager.editorView) {
@ -90,7 +94,9 @@ export default class CodeManager {
}
}
// Update the code, state, and the code the code mirror editor sees.
/**
* Update the code, state, and the code the code mirror editor sees.
*/
updateCodeStateEditor(code: string): void {
if (this._code !== code) {
this.code = code