You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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:
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:
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.
The text was updated successfully, but these errors were encountered:
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:
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.
The text was updated successfully, but these errors were encountered: