I've noticed when writing an app that the settings values for some of the inputs get populated when the app is first started (boolean and numeric enum). However, the settings for other inputs (color and string enum) don't get created until one of those inputs is activated, at which point the settings for those inputs are all created together.
As far as I can tell I cannot create the setting via initialize() in order to provide an initial value that could be used within the code. As noted in the docs app.updateSetting will not create a new setting.
I know I can get around this by using state variables but this seems to add unnecessary complexity.
Is there some way to get the ALL the inputs to initialize their settings at app launch?
Yes it will. If the documents say it won't, that's just wrong. I do it all of the time. Another thing to be aware of is the use of dynamic pages and submitOnChange: true.
This can get tricky. There are circumstances where putting a setting from an input into state is a good thing to do, and then to re-use the setting after doing app.removeSetting().
I'm not sure what you mean by this? There is also defaultValue: that can be used on an input. Also, what do you mean exactly by "app launch"?
Now that I think about it I think read that in the comments of a sample app that looked like boilerplate and I just assumed it was true. I just tried it an you are right so that solves my problem.
By app launch I mean that I am at the application interface screen at the "mainPage". I can do a browser refresh as much as I want and the Settings do not change (Ignore the myHeaderTextSize entry, that was me testing the app.updateSetting ) and only some of the inputs are initialized.
If I click on one of the color inputs (and do nothing else) then suddenly all of the other entries get populated in settings. This has been consistent in my testing.
You have to keep in mind the page rendering that happens. Settings are going to be written when the page is submitted, just as state will be. But there's a difference in timing between the setting being created and written. For the most part, app.updateSetting() will happen immediately, whereas an input's setting will be written (visible in App Status) when the page is submitted. Inputs with submitOnChange: true cause the page to be submitted, so that's why some settings will show up then.