Skip to content

feat(sim): export the LVGL UI tree as JSON from the WASM simulator - #7752

Open
jurgelenas wants to merge 1 commit into
EdgeTX:mainfrom
jurgelenas:wasm-ui-tree-export
Open

feat(sim): export the LVGL UI tree as JSON from the WASM simulator#7752
jurgelenas wants to merge 1 commit into
EdgeTX:mainfrom
jurgelenas:wasm-ui-tree-export

Conversation

@jurgelenas

@jurgelenas jurgelenas commented Sep 3, 2026

Copy link
Copy Markdown
Member

Add simuUiTreeRequest/Ready/Data/Size exports that serialise the live LVGL widget tree (screen, top and sys layers) to JSON so a host can inspect and drive the colour UI in automated tests. The snapshot is built on the GUI task from a hook at the end of LvglWrapper::run(), double-buffered and requested asynchronously; flags select skipping hidden subtrees and including per-node style data. Black-and-white builds keep the exports but report that no tree is available.

Each node carries its LVGL class name, id (object address), absolute coordinates, visibility (display bounds plus ancestor clipping), state and flag booleans (emitted only when set) and widget-specific fields: label/textarea/checkbox text, textarea cursor, keyboard textarea and mode, btnmatrix buttons and selection, bar/arc value range, table cells and selected cell, image source and active tile. The root carries the LVGL version, tick, focused object and edit state.

Add simuIsBootComplete(), latched from the GUI hook once edgeTxInit has run and the Lua interpreter is running, so hosts can wait for a responsive UI instead of sleeping. Bind both in the web host runner.

Fixes #7749

Add simuUiTreeRequest/Ready/Data/Size exports that serialise the live
LVGL widget tree (screen, top and sys layers) to JSON so a host can
inspect and drive the colour UI in automated tests. The snapshot is
built on the GUI task from a hook at the end of LvglWrapper::run(),
double-buffered and requested asynchronously; flags select skipping
hidden subtrees and including per-node style data. Black-and-white
builds keep the exports but report that no tree is available.

Each node carries its LVGL class name, id (object address), absolute
coordinates, visibility (display bounds plus ancestor clipping), state
and flag booleans (emitted only when set) and widget-specific fields:
label/textarea/checkbox text, textarea cursor, keyboard textarea and
mode, btnmatrix buttons and selection, bar/arc value range, table
cells and selected cell, image source and active tile. The root
carries the LVGL version, tick, focused object and edit state.

Add simuIsBootComplete(), latched from the GUI hook once edgeTxInit
has run and the Lua interpreter is running, so hosts can wait for a
responsive UI instead of sleeping. Bind both in the web host runner.
@pfeerick pfeerick changed the title Export the LVGL UI tree as JSON from the WASM simulator feat(sim): export the LVGL UI tree as JSON from the WASM simulator Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose LVGL object tree (with properties) via WASM API for testing and AI-assisted development

2 participants