-
Notifications
You must be signed in to change notification settings - Fork 113
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great changes. Some of them were already on my list, but I did not get to them yet, but many of them I had not even thought of. In general I would merge this pull request, except for two points:
-
Regarding the project name in the header: I like this idea, but what I don't like is that it is read straight from the JSON. This means that if somebody changes the project name in the GUI, the header will not be updated. Furthermore right now it is a hard requirement to have this project name as a configuration item. My proposal would be to read the project name dynamically, and include a fall back to for instance ESP8266 in case of an error, or in case the project name is not defined. And then add an explanation about this in the documentation.
-
I like being able to give a configuration item a different name for the GUI, I also see the benefit in removing the data type for visual consistency, but personally I think it could be handy to see this data type in the interface, also to distinguish between different type of integers. Another way that would be acceptable for me could be to give a default min max for the different integer types, and a default step of 1.
I am curious what your thoughts are, and of course I can also work on this once we agree on an approach :).
Also, regarding your three discussion points:
I am less familiar in this area, so if you have a proposal I am all ears.
Probably because this is the approach I was most familiar with (I am self-taught in JS). I am open for improvements, as long as it does not add a lot of code/dependencies, to keep the footprint as low as possible
I see you already implemented this, and I agree this is much better than the strings approach! |
Good point. I'll move that commit to a separate PR draft for the time being and we can brainstorm about the right way to implement it. I did notice that
I suppose it's a question of who this page is for in an ideal project. Implementers know the data types --- they're the ones that wrote the config file. So I view it as a place for device users instead (and for small projects, that's the same person). I agree that showing the min/max in the UI would be nice, so I'll bring that back. The default Also looking at MDN docs for number inputs I noticed that there's a special
Sounds good 👍
Basically what I think we'd want is to add a dev dependency on eslint, and a reasonable initial config file (such using their recommended defaults, and probably also Ideally we could do this for the cpp code as well, I had been looking into clang-tidy but I'm much less familiar with that part of the stack and I haven't yet got it set up.
No sweat, I'm familiar with JS patterns but haven't written much React (besides tutorials), so this is pretty fun for me to figure out. I believe that this would be a minor refactor inside the React components themselves without any new dependencies. I also don't expect much/any code size change. I'll put that in a separate PR as well so it can be considered separately.
👍 |
You are right that this parameter was already 'mandatory', because it is used in main.c, I forgot about that. Still I think of the main.c more as a template/getting started file, which would maybe be easier to change or modify by the user if they would want to remove projectName from the template configuration for some reason. I expect the typical user to be more skilled in the embedded side of things than the front-end side.
Yes, very good points as well. For the first use case in which I want to use the framework myself, I had actually foreseen to maybe make a custom configuration page tailored more towards end-users. But your addition of the separate name field got me thinking that that would not be necessary. By adding for instance also a description field, or on top of the 'disabled' property a 'hidden' property, the page could be configured and tailored more towards the end-user application. Haha, so many ideas right now. For my application I would need a color picker, but that can potentially also be added as a 'color' datatype that will add a color picker to the interface.
Sounds awesome. I have some experience with linters in other languages, but did never set up eslint in my own toolchain yet. Thanks a lot for your enthusiasm, and don't hesitate to let me know if and where I can assist (I am also learning a lot about Git, since I've mainly worked with SVN in the past and yours have been my first pull requests ;)). |
- this is particularly useful when filling in the fields on mobile, where extra spaces might be added accidentally
- float is still `text`, to avoid the browser constraining the input to "step" increments - since the data type of the config can now be represented by type-specific controls, removing the type/size label
- no server-side validation (yet?)
- use a checkbox UI (requires a little bit of special handling, both for layout and because we need to look at `checked` instead of `value`) - switch from strings to actual boolean values
34fe26f
to
40930b0
Compare
I think another part of it is, what is the expectation for how this project should be used? There's a few ways to think about it. For example, people who want to build apps on this framework might clone/fork and start editing/customizing whatever they want. Of course that's allowed, but it might not be helpful especially if people want to incorporate core changes into their projects later on. I'm still figuring that out myself. One idea I had is to have people start a fresh repo for their own projects instead of fork, but then add this code as a git submodule. To reference an inspiration, this is how themes for the static blogging program Hugo typically work (explanation). The obvious problem is that's a pure web project whereas this is a compiled IoT project so I actually don't know if it can work, but conceptually I like the idea of pulling this project in as a dependency somehow, then in my own repo I have only my own configuration.json, main.cpp, etc, and can easily pull in updates.
It's actually the opposite for me! Web stuff is my day job (although not React), and IoT is the hobby (keep that in mind when I send a future PR to make some cpp changes 😂...)
Done
Haha, congrats I guess. I had been thinking about a possible project for my ESP8266 and when I saw your project here show up on Hack-a-day recently I thought I would see if I could get it running. And that post mainly focused on making HTTPS calls w/o hardcoding cert thumbprints and didn't even mention the self-hosted config dashboard! |
- however, their values still need to be sent back when config is updated
40930b0
to
52b5647
Compare
Here's another question: Is the current handling of |
Yes, it's again a good point. I will give it some thought. Another option could potentially be to make it into a PlatformIO library so that you can include it into your project in that way. But I need to look into this if among other things, you can then still have the benefits of the build hooks straight from a library.
I figured as much :) Thanks, I have merged the pull request. |
You are right, fixed it in afd78e0 |
Finally got to implementing projectName as a title, as you did suggest here as well. Thanks :). |
todo
show project name in page header (instead ofESP8266
)<input>
types for different configuration data types (eg, char -> text, bool -> checkbox, int/float -> numeric)maxlength
attribute for char types, set to configured lengthdisabled
attribute into these config inputs (and ideally, don't persist them if sent)discuss
document.querySelector(...).value
for form inputs rather than data binding?true
/false
for boolean config rather than strings