Repository navigation
Renaming keeps the run - #655
Merged
Merged
Conversation
A node's label and labelAutoComposed are not engine input (SEMANTICS-W.md W3). updateNodeData no longer resets the run for labelAutoComposed, renameDataImportTable no longer bumps, and Undo / Redo leave a node's label and labelAutoComposed out of the decoration check. The rename is still one Undo entry, autosaved, and marks an open revision changed. Part of #619.
Deploying cozy-loop-studio with
|
| Latest commit: |
b67ea1a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://fc7d0b6a.cozy-loop-studio.pages.dev |
| Branch Preview URL: | https://rename-keeps-run.cozy-loop-studio.pages.dev |
5 of 6 tasks
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.
Part of #619 (item 1 only; item 5 stays for its own scope).
What was wrong
SEMANTICS-W.md §W3 says a rename is a cosmetic edit: it does not reset the run or stale a Monte Carlo result. Measured on main
05257b3c, with the single run 3 steps in and a finished Monte Carlo result:label+labelAutoComposed: false)A reset sends the single run to step 0 and marks the Monte Carlo result stale, which turns its export off. Names reach neither the engine's values nor the semantic digest that checks a saved Workspace result.
The change (
src/store/graphStore.ts)One rule,
RUN_KEEPING_NODE_KEYS=label,labelAutoComposed,accent,icon, used in two places:updateNodeDataresets the run only when a patched key is outside that set. Before, the set waslabel,accent,icon, so the first keystroke of an imported Parameter's rename, which also sendslabelAutoComposed: false, reset it.onlyDecorationDiffersleaves those keys out when it compares two snapshots' nodes. Before, it left outaccentandiconand comparedlabel.renameDataImportTableno longer callsbump(). A table name, and the Parameter labels composed from it, are not engine input. Itscommit(one Undo entry, ending "pristine") andpersist(the autosave) are unchanged.onlyAccentsDiffer(kept for its own test) compares exactly as before (accent,icon), and its test is unchanged.No spec changes: this follows §W3.
Tests (
src/store/renameKeepsRun.test.ts), written firstThe fixture is an open project revision (via
routeImport), an imported Parameter feeding a Source's flow, and a plain Parameter.For each of the three renames (plain Parameter, imported Parameter, table):
bump()still saves it.Also:
The first version of the run-keeping test compared the step with a fixed 3, but each start of the runs adds 3 more steps, so a kept run read 6 or 9. It now compares the step with its value just before the action. The corrected tests were run again on main's code (the product change stashed): the same 3 fail. Both runs are kept as records.
Checks
npx tsc -b: clean.npm run lint: 88 warnings, the baseline.check:*scripts: pass.What it touches
label, not only a Parameter's, as an edit already did.