tileclk: lazy-load clock info and use system haptics where available#4194
tileclk: lazy-load clock info and use system haptics where available#4194thyttan merged 2 commits intoespruino:masterfrom
Conversation
|
Hm, the diffview seems to struggle with the app.js file 😅😬 |
Ahh, that must be from line ending changes when switching between linux and windows. I'll see if I can straighten it out. |
e48eba8 to
ef6a5c6
Compare
|
I separated it out, so now if you view the individual commits you can see the actual diff. |
Fix clock-info values of 0 rendering blank and make Dynamic the default seconds mode.
1c113ea to
343ac30
Compare
apps/tileclk/settings.js
Outdated
| }, require("Storage").readJSON("tileclk.json", true) || {}); | ||
|
|
||
| const writeSettings = () => { | ||
| delete appSettings.haptics; |
There was a problem hiding this comment.
Should this really be here? It will try to run everytime a setting is written no?
There was a problem hiding this comment.
Thank you for catching that. It should not be there and was most likely added during the removal of the old app specific haptic settings in favor of the system settings to remove them from the app’s settings.json. I suppose it’s harmless for those dead settings to be left there unused?
There was a problem hiding this comment.
Yes I'd say no harm in letting them be. I guess you could do
if (the setting is still in the settings object) delete that setting
in the outer scope of the tilclk.setting.js file. But no need if you don't feel like it.
|
I presume it's tested and working on your end? |
|
Yes, this is working as expected. I originally tried to speed up rendering as well, but it turned out that it caused more demand on the CPU and actually ran slower in testing. I also had a version working with another clock info at the top, but that still needs refinement. Thanks |
|
Thanks! I'll merge now 🙂 |
This PR lazy-loads the interactive clock_info menu and destroys it again when hidden, reducing memory use when clock info is not being shown.
It also switches tileclk to the system vibration settings. On cutting-edge firmware builds that expose Bangle.haptic, this includes the global haptic strength setting; on older firmware it falls back cleanly to normal Bangle.buzz() behavior.
It also fixes clock_info values of 0 rendering as blank, and changes the default seconds mode to Dynamic.