Start new behavior variables with Keep switched off

Keep is a choice the author makes per variable. Switching it on for
every new variable meant most behaviors carried state across runs that
nobody asked for, and the toggle had to be turned off by hand.

- AddVariableCommand no longer adds a new variable to keptVariables.
  Keep is only switched on by hand.
- Existing projects are unchanged. Their keptVariables stay as saved.
- The comment in Asset.ts describes the new default.
- The counter fixture in keep-state.test.ts now keeps count
  explicitly instead of relying on the old default.

Tests:
- ./check.sh: 2706 tests, CHECK EXIT 0
- e2e 1, 6, 19: ALL PASSED, 172 checks
- 19c-ii expects [] after adding, then ["var1"], [] and ["var1"]
  after undo, all clicked with the real mouse
- Before the fixtures were adjusted, 8 unit tests failed on the new
  default

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 5.5 committed 2026-09-28 12:02:40 +02:00
1 parent 38e0f656be
commit cf6565d108
4 files changed
+12 -14

No files matched your search

+1 -1
View File
@@ -36,7 +36,7 @@ export interface SceneAsset extends AssetBase {
*
* `keptVariables` names the variables a `Run behavior` call hands on to the next call from the same
* node on the same object (#229); the others start at their default every call. Absent keeps none,
* so a project from before the switch runs as it did – a variable added since starts out kept.
* so a project from before the switch runs as it did, and a new variable starts out not kept.
*/
export interface BehaviorAsset extends AssetBase {
type: 'behavior';