Skip to content

DYN-4783: Align invalid input handling for Number, Sliders, and DateTime - #17281

Open
ivaylo-matov wants to merge 7 commits into
DynamoDS:masterfrom
ivaylo-matov:DYN-4783-Warning-signs-on-incorrect-inputs
Open

DYN-4783: Align invalid input handling for Number, Sliders, and DateTime#17281
ivaylo-matov wants to merge 7 commits into
DynamoDS:masterfrom
ivaylo-matov:DYN-4783-Warning-signs-on-incorrect-inputs

Conversation

@ivaylo-matov

Copy link
Copy Markdown
Contributor

Purpose

This PR aims to address DYN-4783 (Do not allow non integer input in Integer Slider node).

The original ticket asked to reject non-integer input on the Integer Slider. After discussion with the team, we aligned invalid-input handling across the related input nodes (Number, Number Slider, Integer Slider, and DateTime) so they share the same behavior as the Number node.

When the user types an invalid value:

  • an error bubble is shown
  • the last valid model value is kept
  • the invalid text remains visible in the text box
  • no undo step is recorded for the failed commit

A subsequent valid commit clears the Error bubble and updates the value. Undo after a valid -> invalid sequence restores the previous valid value and clears the Error bubble. Replacing one invalid input with another shows only the latest error message.

Key changes:

  • shared WPF validation rules for numeric, Int64, and DateTime input
  • sliders and DateTime bind through DynamoTextBox with explicit TwoWay bindings and validation
  • error state is cleared on successful UpdateValueCore and on deserialize/undo
  • regression tests covering the shared invalid-input and undo behavior

This is 4.3 work and is not a priority for review.

DYN-4783-Fix error bubles

Declarations

Check these if you believe they are true

Release Notes

Number, Number Slider, Integer Slider, and DateTime now show an error and keep the last valid value when invalid input is typed.

Reviewers

@DynamoDS/eidos
@jasonstratton
@johnpierson

FYIs

@dnenov
@jnealb

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-4783

@sonarqubecloud

sonarqubecloud Bot commented Aug 7, 2026

Copy link
Copy Markdown

@ivaylo-matov

Copy link
Copy Markdown
Contributor Author

sonarQube is flagging DateTimeInputControl.DateTimeInputControl_Loaded and DynamoSlider.BindValidatedTextBoxes as candidates for static (S2325).

Both methods use XAML instance fields (DateTimeTb, ValTb/MinTb/MaxTb/StepTb), and the DateTime handler also unsubscribes from the instance Loaded event - so they can’t really be static as written righ now. Maybe sonarQube isn’t fully seeing the generated XAML fields? I'll leave them as instance methods if that's okay.

@ivaylo-matov

Copy link
Copy Markdown
Contributor Author

SelfServe if failing, but I can't see the details - not sure it it's false alarm.

Not Found. This page may not exist, or you may not have permission to see it.

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