-
Notifications
You must be signed in to change notification settings - Fork 74
Add "Send after Delay" option to number input widget #2000
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Steve-Mcl <44235289+Steve-Mcl@users.noreply.github.com>
Co-authored-by: Steve-Mcl <44235289+Steve-Mcl@users.noreply.github.com>
|
When Send on Delay is not selected then the behaviour should not be as present, there should be nothing sent on change. |
|
It is also necessary to cope with the "in-place upgrade" situation (where a user has updated their node-red to bring in this updated package). Any existing instance of a ui-number-input node already added to the node-red canvas in the flow should behave as it did before, A test for Additional "is numeric" and is ">= 0" should be made to auto coerce the type/value of |
Co-authored-by: Steve-Mcl <44235289+Steve-Mcl@users.noreply.github.com>
Implemented in 32aec7c:
|
Co-authored-by: Steve-Mcl <44235289+Steve-Mcl@users.noreply.github.com>
|
I tried a different approach with this one. I let copilot have a shot. If you have a chance to review before I do, please feel free to pull and test / review. |
|
Tested works correctly with number input from previous version already in flow - defaulting to existing behaviour. The help text (and presumably docs) should be updated. Is copilot clever enough to generate tests? |
|
Looking at the diffs, it has added |
Add "Send after Delay" option to number input widget
delayandsendOnDelayproperties tonodes/widgets/ui_number_input.htmldefaultsdelayproperty (>= 0) innodes/widgets/ui_number_input.htmlnodes/widgets/ui_number_input.htmltemplatenodes/widgets/locales/en-US/ui_number_input.jsonwith delay-related labelsnodes/widgets/locales/de/ui_number_input.jsonwith delay-related labelsui/src/widgets/ui-number-input/UINumberInput.vue(matching text input behavior)Behavior
For New Nodes (default: sendOnDelay=false, delay=300ms)
For Existing Nodes (upgraded with delay=0, sendOnDelay=true)
When User Enables "Send after Delay"
In-Place Upgrade Handling
delay === undefined) are detected and configured with:delay = 0(immediate sending via delay mechanism)sendOnDelay = true(to preserve existing behavior)This implementation matches the text input widget behavior exactly, fixing the issue where keyboard entry of multi-digit numbers would send a message after each digit.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.