Public Access
Keys: one table file for the device's help panel and the website's key tables (#72)
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:
+6
-19
@@ -1,3 +1,4 @@
|
||||
#include "app_keys.h"
|
||||
#include "gemini_app.h"
|
||||
|
||||
#include <Arduino.h>
|
||||
@@ -303,25 +304,11 @@ void GeminiApp::selectLink(int direction) {
|
||||
}
|
||||
|
||||
void GeminiApp::help(std::vector<KeyHelp>& out) const {
|
||||
if (certDialog_ || deleteDialog_) return help::dialog(out);
|
||||
if (inputOpen_) return help::textEntry(out, "send it");
|
||||
if (addressOpen_) return help::textEntry(out, "go there");
|
||||
out.push_back({"Tab", "the next link"});
|
||||
out.push_back({"Aa Tab", "the link before"});
|
||||
out.push_back({"Enter", "follow the link"});
|
||||
out.push_back({"` Del", "the page before"});
|
||||
out.push_back({"; .", "scroll"});
|
||||
out.push_back({"Space", "a page down"});
|
||||
out.push_back({", /", "sideways, in wide blocks"});
|
||||
out.push_back({"g", "type an address"});
|
||||
out.push_back({"b", "bookmark this page"});
|
||||
if (isSaved()) {
|
||||
out.push_back({"r", "refresh this Saved Page"});
|
||||
out.push_back({"d", "delete this Saved Page"});
|
||||
} else {
|
||||
out.push_back({"s", "save the page to the card"});
|
||||
out.push_back({"S", "...with the pages it links to"});
|
||||
}
|
||||
if (certDialog_ || deleteDialog_) return keys::add(out, keys::kDialog);
|
||||
if (inputOpen_) return keys::add(out, keys::kGeminiAnswer);
|
||||
if (addressOpen_) return keys::add(out, keys::kGeminiAddress);
|
||||
if (isSaved()) keys::add(out, keys::kGeminiSaved);
|
||||
else keys::add(out, keys::kGemini);
|
||||
}
|
||||
|
||||
const char* GeminiApp::helpTitle() const {
|
||||
|
||||
Reference in New Issue
Block a user