Skip to content

Show the info text a command finishes with - #36

Merged
jurgelenas merged 3 commits into
unified-lua-lspfrom
command-result-info
Oct 3, 2026
Merged

jurgelenas merged 3 commits into
unified-lua-lspfrom
command-result-info

Conversation

@jurgelenas

@jurgelenas jurgelenas commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Fixes #17

A device that runs a command immediately may answer START with READY and an info text such as "OK" or "Failed" (the last step of the TBS CRSF command sequence). The session dropped the command on READY and both UIs closed their popup, so the text was never shown.

  • The session keeps a finished command's closing text in commandResult.
  • Colour radios show it in a new shared Dialogs.showInfo dialog with a Close button, opened after the page rebuild so lvgl.clear() doesn't drop it.
  • B&W radios show it in a popup closed by ENTER or EXIT.
  • ELRS finishes commands with an empty info, so ELRS commands behave as before.
  • The CRSF simulator RX gets a Reset Stats command that finishes at once with "OK".

Info sent with PROGRESS and CONFIRMATION_NEEDED was already shown (executing page / confirm prompt); this covers the remaining READY case.

Checked in the simulator:

  • TX16S: Reset Stats shows the dialog, it stays up while related fields reload, and Close returns to the page. Enter Bind Mode (empty info) closes with no popup.
  • GX12: the popup shows "OK"; ENTER and EXIT both close it without leaving the page.

Screenshots

TX16S

screenshot_1790580849

GX12

screenshot_1790581296

@wimalopaan, can you check this on your device?

A device that runs a command immediately may answer START with READY
and an info text such as "OK" or "Failed" (see the TBS CRSF spec
command sequence). The session dropped the command on READY and both
UIs closed their popup, so the text was never seen.

The session keeps a finished command's closing text in commandResult.
Colour radios show it in a new Dialogs.showInfo dialog with a Close
button, opened after the page rebuild so lvgl.clear() does not drop
it. B&W radios show it in a popup closed by ENTER or EXIT. ELRS
finishes commands with an empty info, so its commands are unchanged.

The CRSF simulator RX gets a Reset Stats command that finishes at
once with "OK".

Fixes #17
@wimalopaan

Copy link
Copy Markdown

Thank you very much. Looks good now!!!

@CapnBry CapnBry left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does make sense to show for things that return info in their command conclusion.

showInfo is identical to buildExitDialog though except for the height (which is not a big deal if it is different), it says "Exit" vs "Close" (again, nobody would know the difference) and the screen is cleared before the exit dialog. The last one is the only thing that needs to be separate so both should use the same function to generate their dialogs I think?

I'm also not super-keen on functions that just take a table and you just need to figure out what to put in the table and what it is named and not misspell the names. I've worked on projects where things were just stored in dictionaries and passed dictionaries and it was a nightmare to work with. Super-flexible sure but the cost is a function signature being understandable vs a black box.

…sult-info

# Conflicts:
#	src/SCRIPTS/CRSFSimulator/csrfsimulator.lua
showInfo and buildExitDialog built the same dialog, differing only in
height and button label. Both now go through one buildDialog with a
Close button and the default height; buildExitDialog keeps the
lvgl.clear() before it.

The Dialogs functions take positional arguments instead of an options
table, so their signatures say what they need. showConfirm drops
onCancel, which no caller passed.

The CRSF simulator TX advertises 25 fields again; Reset Stats is an RX
field only.
@jurgelenas
jurgelenas requested a review from CapnBry October 2, 2026 20:33

@CapnBry CapnBry left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks for merging!

@jurgelenas
jurgelenas merged commit b48c8db into unified-lua-lsp Oct 3, 2026
@jurgelenas
jurgelenas deleted the command-result-info branch October 4, 2026 16:35
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.

3 participants