From f6b005e1be49f5ce4fff6ed968c487e049da7e68 Mon Sep 17 00:00:00 2001 From: Kaj Schittecat Date: Thu, 13 Aug 2026 14:20:46 +0200 Subject: [PATCH] apps: SDK Test 1.1 -- fix the entry point (1.0 rendered nothing) My fault, and a good demonstration of why the bench test existed: 1.0 defined app.start(), which the host never calls. The Lua app contract is on_open(w, h) / on_input / on_tick / on_close, so 1.0 loaded cleanly and drew an empty screen -- no error, nothing to see. Also takes the body width from on_open's argument instead of assuming 300 px, so the rows wrap correctly on a Pager or a Tanmatsu rather than only on a T-Deck. Shipped as 1.1 in its own directory: version dirs are immutable, and the catalog bump is what makes a device fetch it at all. Co-Authored-By: Claude Opus 5 --- deploy/apps/apps.json | 2 +- deploy/apps/sdktest/{1.0 => 1.1}/sdktest.json | 2 +- deploy/apps/sdktest/{1.0 => 1.1}/sdktest.lua | 8 +++++--- 3 files changed, 7 insertions(+), 5 deletions(-) rename deploy/apps/sdktest/{1.0 => 1.1}/sdktest.json (76%) rename deploy/apps/sdktest/{1.0 => 1.1}/sdktest.lua (95%) diff --git a/deploy/apps/apps.json b/deploy/apps/apps.json index 8b333da..5315bf0 100644 --- a/deploy/apps/apps.json +++ b/deploy/apps/apps.json @@ -2,5 +2,5 @@ {"id":"monitor","name":"RF Monitor","ver":"1.3","desc":"Scrollable: RSSI/noise chart with dBm axis, link margin, RX rate, radio params, heard feed."}, {"id":"airtime","name":"Airtime","ver":"1.3","desc":"Utilization bars with a % axis, rx/tx split, duty ceiling, budget. Reset button top-right."}, {"id":"snake","name":"Snake","ver":"1.0","desc":"The classic, in Lua. Swipe to steer."}, - {"id":"sdktest","name":"SDK Test","ver":"1.0","desc":"Developer tool. Checks the extended Lua SDK on this board: capabilities, clock, battery, GPS, file access and its limits, keyboard input. Has a button that TRANSMITS a test message to Public (asks permission first)."} + {"id":"sdktest","name":"SDK Test","ver":"1.1","desc":"Developer tool. Checks the extended Lua SDK on this board: capabilities, clock, battery, GPS, file access and its limits, keyboard input. Has a button that TRANSMITS a test message to Public (asks permission first)."} ]} diff --git a/deploy/apps/sdktest/1.0/sdktest.json b/deploy/apps/sdktest/1.1/sdktest.json similarity index 76% rename from deploy/apps/sdktest/1.0/sdktest.json rename to deploy/apps/sdktest/1.1/sdktest.json index 270d321..cb3c1a0 100644 --- a/deploy/apps/sdktest/1.0/sdktest.json +++ b/deploy/apps/sdktest/1.1/sdktest.json @@ -1 +1 @@ -{"id":"sdktest","name":"SDK Test","ver":"1.0","desc":"Developer tool. Checks the extended Lua SDK on this board: capabilities, clock, battery, GPS, file access and its limits, keyboard input. Has a button that TRANSMITS a test message to Public (asks permission first)."} +{"id":"sdktest","name":"SDK Test","ver":"1.1","desc":"Developer tool. Checks the extended Lua SDK on this board: capabilities, clock, battery, GPS, file access and its limits, keyboard input. Has a button that TRANSMITS a test message to Public (asks permission first)."} diff --git a/deploy/apps/sdktest/1.0/sdktest.lua b/deploy/apps/sdktest/1.1/sdktest.lua similarity index 95% rename from deploy/apps/sdktest/1.0/sdktest.lua rename to deploy/apps/sdktest/1.1/sdktest.lua index e0ea742..887904f 100644 --- a/deploy/apps/sdktest/1.0/sdktest.lua +++ b/deploy/apps/sdktest/1.1/sdktest.lua @@ -1,22 +1,24 @@ -- SDK self-test. Exercises everything added to the extended SDK so the results -- can be read off the screen instead of inferred from a build log. --- Not for the store catalog: it is a bench tool. +-- Published to the store as a developer/bench tool. local ui, sys, store, timer = wada.ui, wada.sys, wada.store, wada.timer local C = ui.colors local app = {} local rows, keyline, sendline = {}, nil, nil +local W = 300 -- replaced with the real body width in on_open local function row(y, text, color) local l = ui.label(text, 6, y, 12, color or C.text) - l:width(300) + l:width(W - 12) rows[#rows + 1] = l return l end local function yn(v) return v and "yes" or "NO" end -function app.start() +function app.on_open(w, h) + W = w or 300 ui.scroll(true) local y = 4