avh4 / elm-debug-controls

Easily build interactive UIs for complex data structures
https://avh4.github.io/elm-debug-controls/
BSD 3-Clause "New" or "Revised" License
24 stars 4 forks source link

Control.float #10

Open ianmackenzie opened 4 years ago

ianmackenzie commented 4 years ago

It would be great to have something like

Control.float : { min : Float, max : Float } -> Float -> Control Float

implemented as a slider (in my case, I'd like to make some debug UIs for experimenting with different elm-3d-scene parameter values). Control.int could be implemented similarly (with a step size of 1 set on the underlying HTML slider). Happy to submit a PR if that would be helpful!

avh4 commented 4 years ago

Yeah, I'd be happy to accept a PR for this 👍

ianmackenzie commented 4 years ago

Cool! I do remember running into some "huh..." moments when I wrote my custom implementation of Control.float for my own use case - I vaguely seem to remember concluding that it was inherently different from some of the other controls, in ways that made it non-obvious how to match existing patterns.

I'll try to take another look at the code again and see if I can refresh my mind on what these issues were - are there any particular principles you've been trying to follow with the existing controls, or gotchas to be aware of to make sure that layout works out in a reasonable way in all cases?

avh4 commented 4 years ago

I haven't worked on this in quite a while, but just to dump out the context I recall:

in a future major version, both those things are up for reconsideration, but in the meantime, I've just been living with the current mess, and trying to keep notes of the cases that don't work right to inform the later potential redesign.