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

More customization for usermod configuration, short of a custom settings page #4351

Open
obar opened this issue Dec 6, 2024 · 0 comments
Open
Labels
enhancement usermod usermod related

Comments

@obar
Copy link

obar commented Dec 6, 2024

I was playing around with usermods recently and I asked in discord about existing ways to apply bounds to the input fields: a min and max for a number for example. It seems like right now that isn't possible to do.

There is already the helper bit of js, addInfo, to inject text before and after an element. My idea is: what about injecting text inside the element tag itself? A helper function could take attribute/value pairs and apply them to a given element.

This could be helpful beyond just max and min values in usermod customizing, but I do think those are the lowest hanging fruits in usability wins. A usermod could provide a slider input for a value, or even a color picker:

Screenshot 2024-12-06 at 00-52-23 Usermod Settings

I can see two ways to implement this but there may be other good options. One is a new function (addA, for attributes?) that largely copies addInfo, and the other is to expand addInfo: after the post and pre text strings it could take element attributes. It's kind of info in a way, and that function is already finding the element for us so it's very space efficient with very little extra code.

The color picker example above could be achieved in a usermod with the following line, which is far easier for the usermod creator than a custom settings page if a usermod needed a color:

uiScript.print(F("addA('rotEncBrightness:Favorite Color',1,'input','color')");

Which would, in the same vein as addInfo, apply the attribute input=color to the field. Of course a color picker is icing on the cake but just having it so number inputs don't go out of bounds for the usermod would be nice:

uiScript.print(F("addA('myUsermod:Speed',1,'min','1','max','32')");

Also slider is a great way to convey what a big number and what a small number is for a particular parameter, where the precise value isn't so important.

Just an idea and I'm curious to hear what others think about it, both in terms of utility and the implementation.

@softhack007 softhack007 added the usermod usermod related label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement usermod usermod related
Projects
None yet
Development

No branches or pull requests

2 participants