Repository navigation
feat: settings page - #343
Merged
Merged
feat: settings page #343
Conversation
gmmcosta15
reviewed
Oct 9, 2026
Collaborator
There was a problem hiding this comment.
Good
- Changes are saved when you leave the page, with Restart/Discard. Reverting an edit removes it from the pending list.
- Saving reuses the configfile API, which writes atomically and keeps the file layout.
- Booleans are written back in their original style (yes/no or true/false), and set_checked blocks signals, so setting the toggle from code doesn't count as an edit.
- The line edit now respects its alignment setting, and nothing else changes by default.
- infoPage.py is removed cleanly, [server] is read-only, the timeout shows in minutes, and Restart works (BlocksScreen is in moonraker.asvc).
- ruff, pylint, docstrcov and pytest pass.
Blocking
Edits don't persist on any printer. ConfigManager resets BlocksScreen.cfg from ~/RF50-Klipper on every start, so a change lasts one boot and then reverts.
- The edit only seems to survive because the config is loaded into memory before the sync overwrites the file.
- Local and sim runs don't show this because they have no RF50-Klipper repo.
Fix: store user changes outside the managed file. For example, use a KlipperScreen-style #~# Do not edit below this line block, copied with merge_cfg(marker=...) the same way printer.cfg is, and have configfile read it as overrides.
Needs fixing
- Validation:
- A timeout of 0 locks the touchscreen, and a non-numeric value crashes the UI.
- Today the reset undoes these after a power cycle. Once edits persist, they'd become a permanent lockout or crash loop.
- The timeout needs to be an integer with a minimum.
- Explicit settings list:
- On Release-2.0 printers the page shows only Server (read-only) and Screensaver timeout, so the screensaver timeout is the only editable value. The screensaver section is shown there, because the hidden key only exists in this repo's cfg.
- A short list of editable options (type, range, unit) would replace the generic editor and the hand-maintained hidden-section list, solve both TODOs, and keep future sections or secrets off the page.
Minor
- Restart fallback: restart_service() returns True once the request is sent, even if Moonraker refuses it. On an older image without BlocksScreen in moonraker.asvc, the restart would silently never happen. Checking the response would cover that.
- Use configparser's built-in getboolean instead of a custom BOOLEAN_STATES. Right now hidden: on or hidden: 1 are ignored.
- There are no tests for ConfigPage or the Toggle mode.
gmmcosta15
approved these changes
Oct 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
BlocksScreen/lib/panels/widgets/UtilitiesTab/configPage.py
BlocksScreen.cfg
BlocksScreen/lib/panels/widgets/UtilitiesTab/infoPage.py
BlocksScreen/lib/panels/utilitiesTab.py
BlocksScreen/lib/utils/blocks_field.py
BlocksScreen/lib/utils/blocks_linedit.py