-
Notifications
You must be signed in to change notification settings - Fork 19
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
Refactor the UI to be Elm architecture #85
Comments
Okie... I have made a widget that replicates (good enough) the behavior of the user/session input widget. It works like this: you give it options and initial state (which can even be the freeform manual input thing) and it sends Output messages with what the user has typed/clicked from list. The widget works by itself, but I anticipate it being a challange to integrate into the current app. |
These are the images of the most bare bones implementation that I made, you can see there's no styling, gaps, the toggle button is in the wrong state, it will be more polished in the PR. This window has a box: left: input widget, right: what the root thinks the widget state is (text after the toggle button). The input widget can be customized: label text, manual input placeholder (gray text) and the list of options, initial state. It emits events with what is selected, either index of the current option in the list (number) or the string in the text field, whichever the user sees. |
I think this will make the code a little cleaner and easier to work with |
Here are the changes I propose:
template. Instead, if you take a look at the current UI there's:
separate type for each element.
the ui.
if demo {
Make aDemoGreeter
. Btw this demo greeter can respond with "Demo mode password: pass".And this way the UI can be tested too by simply setting up the UI state struct, running the update() method and asserting the updated ui state.
I can do the refactoring work and PR it in as small of increments as is managable for review. The steps would probably be as such (not sure about the order):
update()
.These 2 might be too tightly coupled to separate tho...
The text was updated successfully, but these errors were encountered: