Keys: one table file for the device's help panel and the website's key tables (#72)
CI / build (pull_request) Successful in 7m14s
Site / build (pull_request) Successful in 8s

Every screen's keys are constant tables in lib/core/src/app_keys.h (52 of
them, each under an `// id: Title` comment). An App's help() picks the table
of the state it is in. site/tools/gen_dev_docs.py reads the same file and
writes site/data/keys.toml; the `keys` shortcode shows a screen's tables on
its guide page, and /guide/keys/ shows all of them.

The Site job fails when the data file is out of date or a page asks for a
table that doesn't exist, and now also runs when app_keys.h changes. A key
added to an App shows up on the website without anyone editing a page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EhqxQ49eCju4CzKYNjZzwT
This commit is contained in:
2026-10-07 01:42:48 +02:00
co-authored by Claude Opus 5.5
parent 82023d36b3
commit 34e6714785
41 changed files with 1213 additions and 228 deletions
+9 -17
View File
@@ -1,3 +1,4 @@
#include "app_keys.h"
#include "wifi_settings_page.h"
#include "ipv4.h"
@@ -449,25 +450,16 @@ void WifiSettingsPage::draw(Canvas& c) {
}
void WifiSettingsPage::help(std::vector<KeyHelp>& out) const {
if (forgetDialog_) return help::dialog(out);
if (forgetDialog_) return keys::add(out, keys::kDialog);
switch (view_) {
case View::Main:
help::list(out, "open, or change");
out.push_back({", /", "switch Wi-Fi on or off"});
break;
case View::Servers:
help::list(out, "edit");
out.push_back({", /", "Always use my DNS: on, off"});
break;
case View::Network:
help::list(out, "edit, or forget");
out.push_back({", /", "Automatic or Fixed"});
break;
case View::Details: out.push_back({"Enter", "back"}); break;
case View::Scan: help::list(out, "choose this network"); break;
case View::Ssid: help::textEntry(out, "next: the password"); break;
case View::Main: keys::add(out, keys::kWifi); break;
case View::Servers: keys::add(out, keys::kWifiServers); break;
case View::Network: keys::add(out, keys::kWifiNetwork); break;
case View::Details: keys::add(out, keys::kWifiStatus); break;
case View::Scan: keys::add(out, keys::kWifiScan); break;
case View::Ssid: keys::add(out, keys::kWifiName); break;
case View::Password:
case View::Edit: help::textEntry(out); break;
case View::Edit: keys::add(out, keys::kText); break;
}
}