Skip to content
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

@PredicateConstraint doesn't give visual feedback, whether an input is valid or not #309

Open
Zappic3 opened this issue Sep 18, 2024 · 0 comments

Comments

@Zappic3
Copy link

Zappic3 commented Sep 18, 2024

owo_version=0.12.14+1.21

When using the @PredicateConstraint in my config model, the value inside the input box appears green, even though the value does not satisfy the @PredicateConstraint. This gives the impression that the input is valid, which can be misleading for users. The only sign that the config value didn't get saved is a log message, that is probably overlooked by most users.

grafik
How it looks to the user

[Render thread/WARN] (owo) Option Key{path=[maxMediaSize]} in config 'mod' could not be updated, as the given value '-123' does not match its constraint: Predicate method maxMediaSizePredicate
The only sign that the config didn't get saved. Probably overlooked by most users

Expected Behavior:
The input box should visually indicate when a @PredicateConstraint is not satisfied by turning the text red, similar to how other invalid inputs are indicated.

(I have only tested this with int values)

My Code:

@PredicateConstraint("maxMediaSizePredicate")
public int maxMediaSize = 30;
public static boolean maxMediaSizePredicate(int maxMediaSize) {
        return maxMediaSize > 0;
}
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

No branches or pull requests

1 participant