@@ -191,7 +191,7 @@ local function createSpinner(parent)
191191 })
192192end
193193
194- function CommandPage .showConfirm (name , info , onConfirm , onCancel )
194+ function CommandPage .showConfirm (name , getInfo , onConfirm , onCancel )
195195 lvgl .clear ()
196196 local pg = lvgl .page ({
197197 title = " ExpressLRS" ,
@@ -226,7 +226,8 @@ function CommandPage.showConfirm(name, info, onConfirm, onCancel)
226226 w = lvgl .PERCENT_SIZE + 100 ,
227227 align = CENTER ,
228228 color = COLOR_THEME_DISABLED ,
229- text = info or " " ,
229+ -- Prompt supplied by the caller as a getter so it refreshes each frame
230+ text = getInfo ,
230231 },
231232 {
232233 type = lvgl .RECTANGLE ,
@@ -261,7 +262,7 @@ function CommandPage.showConfirm(name, info, onConfirm, onCancel)
261262 return pg
262263end
263264
264- function CommandPage .showExecuting (title , onCancel )
265+ function CommandPage .showExecuting (title , getInfo , onCancel )
265266 lvgl .clear ()
266267 local pg = lvgl .page ({
267268 title = " ExpressLRS" ,
@@ -287,6 +288,21 @@ function CommandPage.showExecuting(title, onCancel)
287288 })
288289 createSpinner (container )
289290 container :build ({
291+ {
292+ type = lvgl .RECTANGLE ,
293+ w = lvgl .PERCENT_SIZE + 100 ,
294+ h = lvgl .PAD_LARGE ,
295+ thickness = 0 ,
296+ },
297+ {
298+ -- Live status text the device sends back while the command runs.
299+ -- Supplied by the caller as a getter so each CMD_QUERY poll response is shown.
300+ type = lvgl .LABEL ,
301+ w = lvgl .PERCENT_SIZE + 100 ,
302+ align = CENTER ,
303+ font = BOLD ,
304+ text = getInfo ,
305+ },
290306 {
291307 type = lvgl .RECTANGLE ,
292308 w = lvgl .PERCENT_SIZE + 100 ,
@@ -538,15 +554,20 @@ local function handleCommandPopup()
538554 UI .invalidate ()
539555 elseif Protocol .fieldPopup .status == Protocol .CRSF .CMD_ASKCONFIRM then
540556 if not UI .commandDialog or Protocol .fieldPopup .lastStatus ~= Protocol .CRSF .CMD_ASKCONFIRM then
541- UI .commandDialog = CommandPage .showConfirm (Protocol .fieldPopup .name , Protocol .fieldPopup .info , function ()
557+ local field = Protocol .fieldPopup
558+ UI .commandDialog = CommandPage .showConfirm (field .name , function ()
559+ return field .info or " "
560+ end , function ()
542561 Protocol .commandConfirm ()
543562 end , onCommandCancel )
544563 end
545564 Protocol .fieldPopup .lastStatus = Protocol .fieldPopup .status
546565 elseif Protocol .fieldPopup .status == Protocol .CRSF .CMD_EXECUTING then
547566 if not UI .commandDialog or Protocol .fieldPopup .lastStatus ~= Protocol .CRSF .CMD_EXECUTING then
548- UI .commandDialog =
549- CommandPage .showExecuting (Protocol .fieldPopup .name or Protocol .fieldPopup .info , onCommandCancel )
567+ local field = Protocol .fieldPopup
568+ UI .commandDialog = CommandPage .showExecuting (field .name , function ()
569+ return field .info or " "
570+ end , onCommandCancel )
550571 end
551572 Protocol .fieldPopup .lastStatus = Protocol .fieldPopup .status
552573 end
0 commit comments