Skip to content

Wait node: palette chip, editor for the time, title shows it - #14

Merged
Prengemann merged 1 commit into
mainfrom
feature/18-wait-knoten
Nov 16, 2026
Merged

Prengemann merged 1 commit into
mainfrom
feature/18-wait-knoten

Conversation

@Prengemann

Copy link
Copy Markdown
Contributor

Why

A Wait node could only come from an imported scenario file (internal board, issue 18). Its time could only be changed in the file, and on the canvas the node showed its display name or the bare number. A value the engine cannot read ("20 s", "12,6") silently meant "no wait".

The planned connection-drop scenario needs waits that can be set in the app. The editor is built so that the two coming node types with a time in ms (drop connection, wait for communication) can use it.

Changes

  • Palette: chip WAIT next to AND. Dropping it on the canvas makes a Wait node with 1000 ms (ScenarioNodeViewModel.CreateStructural).
  • Editor: double-click, right-click or Enter on a Wait node opens the dialog "Wait" with the field "Wait time (ms)" (NodeMillisecondsViewModel, NodeMillisecondsView, hosted in DialogWindow).
    • It accepts a whole number from 1 to 2147483647 in digits and writes it to TransactionName.
    • OK stays disabled while the text is not such a number, and the message under the field says why.
    • Spaces and characters nobody can see at the ends (non-breaking space, zero-width space) are ignored. Inside the number the message names them.
    • Title, label and minimum are parameters.
  • Title (WaitTime.Title): "Wait 1500 ms". A value the engine does not wait for shows as "Wait (invalid: 20 s)" or "Wait (no time set)".
    • A character nobody can see in such a value shows as [U+00A0].
    • A display name from a file no longer replaces the time.
    • A leading sign ("+5", only possible in a hand-edited file) counts only if the culture of the computer reads it too. The engine up to package 1.0.0-build-0027 reads with that culture, the engine after SecsGemBase pull request 12 with the invariant culture. On Windows the two normally agree.
  • Colour: Wait nodes get their own colour on the canvas.
  • Docs:
    • README: how to make a Wait node. The sentence on node types no longer says that Send & Wait waits for the reply or that Receive has a 30 s timeout; neither was true.
    • specification/features.md (new section) and specification/dialog_pattern.md (mapping rows).

Known limits

  • Engine warning: the engine's own warning for a time it cannot read is SecsGemBase pull request 12. It reaches the app only with a package published after that merge. Every package up to 1.0.0-build-0027 skips the wait silently, and the title is then the only sign.
  • Wiring in the view: ScenariosViewModel.OpenNodeEditor, the palette chip and the XAML have no unit test. The view model needs the whole DI graph and reads the user's profile in its constructor. They are covered by the run in the app below; the dialog mapping in WindowMapper has a test.
  • Wait 0: the editor's minimum is 1. A node from a file with "0" shows "Wait 0 ms" and does not wait, which is what the engine does.

Verification

  • Build and tests: Linux SDK, Release build of app and tests with 0 warnings, 0 errors. Tests under Wine with Windows .NET: 82/82 pass.
  • New tests: 53 new test cases in WaitNodeTests and NodeMillisecondsViewModelTests.
  • Counter-checks: 26 mutations, each applied alone; every one turns the matching tests red:
    • title as before (display name or bare number)
    • invalid value not shown
    • negative number shown as a time
    • no default time from the palette
    • default time for every palette node
    • editor reads signs and the computer's culture
    • minimum ignored
    • editor does not ignore spaces at the ends
    • value written without OK
    • OK without the check
    • OK always enabled
    • no change notification for the message
    • no CanExecuteChanged for the OK button
    • raw text written instead of the digits
    • hidden characters not shown in the title
    • line ends not trimmed in the title
    • format characters (zero-width space) not shown
    • plain space shown as a code
    • title reads only with the computer's culture
    • title reads only with the invariant culture
    • no dialog mapping
    • editor start text trims white space only
    • editor input trims white space only
    • message does not name hidden characters
    • ends trimmed only at the start
    • ends trimmed only at the end
  • Run in the real app (Wine, Xvfb, throwaway profile, final state of this branch):
    • A scenario file with the times "20 s", a non-breaking space before "1500", "1500" with a zero-width space behind it, "15" + zero-width space + "00", and "250" shows "Wait (invalid: 20 s)", "Wait (invalid: [U+00A0]1500)", "Wait (invalid: 1500[U+200B])", "Wait (invalid: 15[U+200B]00)" and "Wait 250 ms".
    • The editor opens the third node with "1500" and OK enabled; the OK button writes it ("Wait 1500 ms").
    • The editor opens the fourth node with OK disabled and the message that names the character. After typing 400 the OK button writes it.
    • Run logs "Waiting 1500ms...", "Waiting 400ms..." and "Waiting 250ms..." with matching timestamps. The two nodes still shown as invalid are not waited for.
    • On an earlier state of the branch (the dialog, the chip and the node view model are unchanged since): dragging the WAIT chip makes "Wait 1000 ms"; a node with "20 s" opens with the message and OK disabled, and OK is enabled again after a correction; Enter confirms the dialog; the value survives a restart.
  • Independent review: two rounds (app code and tests, engine, written claims), every finding checked by a second agent. All confirmed findings are applied.
  • Not tested on Windows itself; CI runs the build and tests on windows-latest.

🤖 Generated with Claude Code

A Wait node could only come from an imported file, its time could only be
changed in the file, and the node showed its display name or the bare
number. A value the engine cannot read ("20 s", "12,6") silently meant
"no wait".

- Palette: chip WAIT next to AND. Dropping it makes a Wait node with
  1000 ms (ScenarioNodeViewModel.CreateStructural).
- Editor: double-click, right-click or Enter on a Wait node opens the
  dialog "Wait" with the field "Wait time (ms)" (NodeMillisecondsViewModel,
  NodeMillisecondsView, hosted in DialogWindow). It accepts a whole number
  from 1 to 2147483647 in digits and writes it to TransactionName. Spaces
  and characters nobody can see at the ends are ignored; inside the number
  the message names them. Title, label and minimum are parameters, so
  other node types with a time in ms can use it.
- Title: "Wait 1500 ms"; "Wait (invalid: 20 s)" or "Wait (no time set)"
  for a value the engine does not wait for (WaitTime). A character nobody
  can see in such a value shows as [U+00A0]. A display name no longer
  replaces the time. A leading sign counts only if the culture of the
  computer reads it too: the engine up to package 1.0.0-build-0027 reads
  with that culture, a later one with the invariant culture.
- Wait nodes get their own colour on the canvas.
- README: how to make a Wait node. The sentence on node types no longer
  says that Send & Wait waits for the reply or that Receive has a 30 s
  timeout.
- specification/features.md and dialog_pattern.md.

New tests: WaitNodeTests and NodeMillisecondsViewModelTests (53 cases).

Internal board: secsgem/evencoolerfastsim issue 18.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@Prengemann
Prengemann merged commit 66353d1 into main Nov 16, 2026
1 check passed
@Prengemann
Prengemann deleted the feature/18-wait-knoten branch November 16, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant