Repository navigation
A trigger's Delay stores only a whole number of steps - #659
Merged
Merged
Conversation
The Delay field uses DraftNumberInput: a real blank removes the delay, only a whole number >= 0 is stored, and anything else is a draft that stores nothing, with the hint following the draft. A value already stored invalid keeps the engine's 0 and diagnostic. Part of #615.
Deploying cozy-loop-studio with
|
| Latest commit: |
cda5fce
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://6be2c717.cozy-loop-studio.pages.dev |
| Branch Preview URL: | https://delay-field-draft.cozy-loop-studio.pages.dev |
inspector.delay.bad in every language drops its second half, that the engine runs any other value as 0 and leaves what was typed untouched: an invalid draft is now discarded on leaving the field, so the rule alone is right for a draft and for a value already stored invalid. The pt-PT audit (now the same as pt-BR on this key) and the ru ё-word list follow. Part of #615.
This was referenced Nov 24, 2026
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 #615 (item 1's trigger delay; the two wizards' header-row fields of item 1 are next).
What was wrong
A Trigger connection's Delay (
Inspector.tsx,TriggerFields) was a plain number input that storedNumber(v)on every key. Measured on maincaa763c5, from a delay of 2 with the run at step 1 (scratchprobe, run 3):-'')-2-, then -21.51and53Measured diagnostics: on the next step (the play bar's Step button, waited until the step settled) the run diagnostics showed exactly one line for
-2and for1.5, the same in the sim store and on screen: "State edge "t_pd_a" delay -2 is not an integer ≥ 0; treated as 0." For-, a blank and3there was none.Read from the code, not measured (
step.ts:1064-1074): that such a value is then used as 0, and that a removed delay is also read as 0, without a diagnostic.The change
The Delay field uses
DraftNumberInput(#658's rule):valid);-(validity.badInput),-2,1.5. On leaving, the field shows the stored delay again.The hint under the field now follows the draft as well as the stored value. "use a whole number ≥ 0." shows for an invalid draft, and still for a delay already stored invalid.
A delay already saved in a file as another number is shown as it is, marked and hinted. The engine still runs it as 0 with its diagnostic; that path is unchanged.
Tests
e2e/number-field-blank.spec.ts(written first; run on main's code first):-from 2: stored, autosave, run step kept;aria-invalidand the bad hint while typing; on leaving the field shows 2 and the ok hint-2from 2: the same1.5: the1is stored and resets the run (rev +1, step 0) as a valid number on the way; then.and5change nothing more;aria-invalidand the bad hint; on leaving, the field shows 1 and 1.5 was never stored5(.already changed nothing)3is stored, both reset the run, the ok hinte2e/state-ui.spec.ts:112pinned the old contract: "the stored value is left exactly as typed" (-1 stored). No spec document states it (searcheddocs/), and the decision for this item replaces it. The test now expects the stored 2 to stay, with the field still marked and hinted, and its title says "nor stored when invalid".Checks
npx tsc -b: clean.npm run lint: 88 warnings, the baseline.check:*scripts: pass.The hint's wording (second commit, at Lumi's review)
The bad hint read "use a whole number ≥ 0 — the engine runs any other value as 0 and leaves what you typed untouched." For a typed draft, which is now discarded on leaving the field, "leaves what you typed untouched" was no longer true.
inspector.delay.badnow gives only its rule, in every one of the 18 languages: the part before the dash (before the colon in Spanish, before the double dash in Chinese). In English: "use a whole number ≥ 0." That reads right for a draft and for a value already stored invalid. There is no new key.Two pinned audits follow:
введённоеwas only in the removed half.The e2e hint checks now compare the full text.
What it touches