Show the dialog before running update, switch to stock and shutdown commands - #286
Merged
pellcorp merged 1 commit intoSep 7, 2026
Merged
Conversation
Author
|
I'm no coder but I can work through basic understanding stuff. I have a Claude max plan and figured I would put it to use for the greater good. Happy to change/fix/remove if you give the word. I did install and test on my Centauri Carbon 1 w/canvas for a dry run,dry fail, and production. Appreciate everyone on this project! |
Owner
|
Wonderful, I can take a look at these soon, thanks for taking the time, this sort of stuff is really great polish that helps everyone. |
Owner
|
please rebase on latest main, as I just merged the large MMU PR. |
…ommands The update, switch-to-stock and shutdown-host handlers ran their command synchronously on the LVGL thread from inside the click dispatch and only created the "Initiated" dialog after the command returned. Commands that end in a reboot never return, so the screen showed nothing at all until the printer restarted, not even the button's pressed state. Factory reset already avoids this by creating the dialog first and deferring the command to a one-shot lv_timer. Generalise that into run_command_deferred() and use it for all four commands. Factory reset keeps its 5 s delay; the others wait 500 ms, enough for LVGL to render the dialog before the command blocks the thread. Failure handling is unchanged: a non-zero exit replaces the dialog with the "Failed" one. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
kyleinoregon
force-pushed
the
fix/deferred-command-feedback
branch
from
September 6, 2026 21:04
08508fb to
d05eb84
Compare
Author
Owner
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.
Problem
Pressing Update (and likewise Switch to Stock and Shutdown Host) and confirming the prompt gives no visible feedback at all: the button never shows its pressed colour and no dialog appears. The next thing you see is the printer rebooting. On COSMOS the update command downloads about 124 MB and flashes before it reboots, so the screen looks dead for several minutes and it is tempting to power-cycle in the middle of it.
The cause is in
SettingPanel::handle_callback: the command runs throughcall_command()(sp::call, i.e.Popen().wait()) synchronously on the LVGL thread, inside the confirm dialog's click dispatch, and the "Initiated" dialog is only created after the command returns. A command that ends inrebootnever returns, solv_timer_handler()never gets to draw anything.The factory reset button already avoids this: it creates the dialog first and defers the command to a one-shot
lv_timer.Change
run_command_deferred(), taking the failure title and message so the callback is shared.Tested
GUPPY_SMALL_SCREENand COSMOS's build variables and run on an Elegoo Centauri Carbon (480x272) on COSMOS 26.08.0. Confirming Update now shows "Update COSMOS Initiated" immediately; the update then ran to completion and rebooted.UPDATE_CMD, so the shutdown-host path) with no warnings.