Skip to content

Conversation

@r00tens
Copy link
Contributor

@r00tens r00tens commented Jul 12, 2025

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

  1. NewUITextBox enhancements

    • Added TriggerInvalidBlink() method to start the blink animation.
    • Extended DrawSelf() to handle blink timing and apply temporary styles.
  2. Filter validation methods

    • ValidateItemFilter(), ValidateItemDescription(), ValidateNPCFilter()
    • Now call TriggerInvalidBlink() on no-match.
  3. XML documentation

    • Updated <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

@JavidPack
Copy link
Owner

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.

@JavidPack
Copy link
Owner

Seems like everyone likes the red text approach better, so I guess I'll do that instead. Is that other branch good to PR?

@r00tens
Copy link
Contributor Author

r00tens commented Jul 29, 2025

Yes, the feat/highlight-unmatched-suffix-in-search-fields branch is ready.

There’s also a hybrid proposal here:
https://discord.com/channels/276235094622994433/556368563942981643/1395026378990288896

By the way, should we address the potential overflow issue in this case?
obraz
For example, we could limit the number of characters (perhaps based on the field’s width), enable moving the text cursor with arrow keys, or allow horizontal scrolling of the text.

@JavidPack
Copy link
Owner

Yes, the feat/highlight-unmatched-suffix-in-search-fields branch is ready.

There’s also a hybrid proposal here: https://discord.com/channels/276235094622994433/556368563942981643/1395026378990288896

By the way, should we address the potential overflow issue in this case? obraz For example, we could limit the number of characters (perhaps based on the field’s width), enable moving the text cursor with arrow keys, or allow horizontal scrolling of the text.

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.

@r00tens r00tens marked this pull request as draft August 1, 2025 13:38
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.

Limiting text input in search fields is confusing

2 participants