feat: show units and ranges for numeric settings - #911
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #911 +/- ##
===========================================
+ Coverage 97.41% 97.44% +0.02%
===========================================
Files 83 83
Lines 10856 10901 +45
===========================================
+ Hits 10575 10622 +47
+ Misses 281 279 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
qlrd
left a comment
There was a problem hiding this comment.
First round :)
I liked the change. One thing that, IMO, you could change is [0-N] to non-zero value, like [1-N] or [5-N] (or maybe when use choose zero show a warning that feature will be disabled, just as "backup warning"). Other that don't have 0, just ignore the idea. About Touchscreen is worth to have it too?
|
Thanks for taking a look and for the suggestions! I kept 0 in the ranges because it is a valid value for both Screensaver Time and Shutdown Time, and it is how those features are disabled. Showing [1-N] or [5-N] would make the range on screen different from what the setting actually accepts. I left the warning out of this PR because it would need another prompt and new translations. If we want that warning, I think it would be better as a separate change. Touchscreen was worth adding. I pushed the [2-200] range for Touch Threshold and updated the screenshot too. |
|
Looks good to me, both UI and implementation. |
qlrd
left a comment
There was a problem hiding this comment.
Two more nits on tests (optional). Tested those applying same idea on previous comment. WDYT?
ecf1285 to
97fd814
Compare
|
Thanks, all nits make sense to me, applied all three. The assertions are cleaner and more readable now. |
b46b0f7 to
2ed88ec
Compare
2ed88ec to
16316c0
Compare
|
My bad, earlier I squashed everything into one commit. I’ve fixed that now and split it into separate feat, test and docs commits. |
What is this PR for?
This adds units and allowed ranges to Screensaver Time, Shutdown Time, and Buttons Debounce in the existing numeric editor.
The editor keeps the full text on one line when it fits. If it does not, it shows the value and unit, then the raw value. This keeps long input from wrapping into the M5StickV keypad. Stored values, validation, and input behavior are unchanged.
Design reference
Numeric setting context - Krux
Changes made to:
Did you build the code and tested on device?
What is the purpose of this pull request?
Verification
Hardware demo
Krux.numeric.mp4