Skip to content

tileclk: lazy-load clock info and use system haptics where available#4194

Merged
thyttan merged 2 commits intoespruino:masterfrom
stweedo:tileclk-optimize-redraws
Mar 26, 2026
Merged

tileclk: lazy-load clock info and use system haptics where available#4194
thyttan merged 2 commits intoespruino:masterfrom
stweedo:tileclk-optimize-redraws

Conversation

@stweedo
Copy link
Copy Markdown
Contributor

@stweedo stweedo commented Mar 18, 2026

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.

@thyttan
Copy link
Copy Markdown
Collaborator

thyttan commented Mar 18, 2026

Hm, the diffview seems to struggle with the app.js file 😅😬

@stweedo
Copy link
Copy Markdown
Contributor Author

stweedo commented Mar 18, 2026

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.

@stweedo stweedo force-pushed the tileclk-optimize-redraws branch from e48eba8 to ef6a5c6 Compare March 18, 2026 23:18
@stweedo
Copy link
Copy Markdown
Contributor Author

stweedo commented Mar 18, 2026

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.
@stweedo stweedo force-pushed the tileclk-optimize-redraws branch from 1c113ea to 343ac30 Compare March 21, 2026 04:24
@stweedo stweedo changed the title tileclk: optimize redraws and reduce memory use tileclk: lazy-load clock info and use system haptics where available Mar 22, 2026
}, require("Storage").readJSON("tileclk.json", true) || {});

const writeSettings = () => {
delete appSettings.haptics;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this really be here? It will try to run everytime a setting is written no?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@thyttan
Copy link
Copy Markdown
Collaborator

thyttan commented Mar 26, 2026

I presume it's tested and working on your end?

@stweedo
Copy link
Copy Markdown
Contributor Author

stweedo commented Mar 26, 2026

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

@thyttan
Copy link
Copy Markdown
Collaborator

thyttan commented Mar 26, 2026

Thanks! I'll merge now 🙂

@thyttan thyttan merged commit 68372a4 into espruino:master Mar 26, 2026
2 checks passed
@stweedo stweedo deleted the tileclk-optimize-redraws branch March 28, 2026 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants