feat(ui): visual feedback for invalid search input#180
feat(ui): visual feedback for invalid search input#180r00tens wants to merge 1 commit intoJavidPack:1.4from
Conversation
|
Looks great. I like the blink rather than the other approach personally, but I'm gonna do a quick poll on Discord before merging just to be sure it's not just me. |
|
Seems like everyone likes the red text approach better, so I guess I'll do that instead. Is that other branch good to PR? |
|
Yes, the There’s also a hybrid proposal here: By the way, should we address the potential overflow issue in this case? |
Ok, lets go with the hybrid approach then, that is a good point brought up on Discord that if the 1st letter is already wrong then it isn't clear what is happening. As for limiting the input text box, allowing cursor left/right support is probably the best solution, but I don't have code implementing that handy. I know others have made their own textboxes that support that, but I never got around to supporting it. |


Related Issue
Closes #168
Problem
When a user types a character that yields no match, the last character is immediately removed. Many users interpret this as a bug or as an indication that the mod has stopped working. There’s no clear indication why input is being rejected.
Proposed Solution
Introduce a brief "blink" animation on the search field to signal invalid input, in addition to silently truncating the text. When the filter finds no matches, the field border and background flash briefly.
Changes
NewUITextBoxenhancementsTriggerInvalidBlink()method to start the blink animation.DrawSelf()to handle blink timing and apply temporary styles.Filter validation methods
ValidateItemFilter(),ValidateItemDescription(),ValidateNPCFilter()TriggerInvalidBlink()on no-match.XML documentation
<summary>comments for all affected methods to reflect the new behavior.Demo
feedback-when-search-input-limited.mp4
Alternatives Considered
Highlight unmatched suffix in search fields (see: a8eae24 and 3e4e5f6)
Demo
highlight-unmatched-suffix-in-search-fields.mp4