Skip to content

feat: settings page - #343

Merged
gmmcosta15 merged 16 commits into
devfrom
feat/config-page
Oct 13, 2026
Merged

gmmcosta15 merged 16 commits into
devfrom
feat/config-page

Conversation

@RobeMartins

Copy link
Copy Markdown

Description

  • Feature

BlocksScreen/lib/panels/widgets/UtilitiesTab/configPage.py

  • added settings page (a way to edit BlockScreen.cfg via screen)
image

BlocksScreen.cfg

  • added Hidden flag to Screensaver
  • added amu section for future work

BlocksScreen/lib/panels/widgets/UtilitiesTab/infoPage.py

  • deleted infoPage.py (no longer used)

BlocksScreen/lib/panels/utilitiesTab.py

  • removed info button and added settings button
image

BlocksScreen/lib/utils/blocks_field.py

  • added toggle button as an option

BlocksScreen/lib/utils/blocks_linedit.py

  • removed hardcoded alignment

@RobeMartins
RobeMartins requested a review from gmmcosta15 October 8, 2026 14:26
@RobeMartins RobeMartins self-assigned this Oct 8, 2026

@gmmcosta15 gmmcosta15 left a comment •

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.

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
gmmcosta15 merged commit c9d4143 into dev Oct 13, 2026
9 checks passed
@gmmcosta15
gmmcosta15 deleted the feat/config-page branch October 13, 2026 16:48
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