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:
@@ -1,3 +1,4 @@
|
||||
#include "app_keys.h"
|
||||
#include "storage_app.h"
|
||||
|
||||
#include <Arduino.h>
|
||||
@@ -279,26 +280,13 @@ void StorageApp::help(std::vector<KeyHelp>& out) const {
|
||||
case View::Maintenance: return maintenance_.help(out);
|
||||
case View::Editor: return noteEditor_.help(out);
|
||||
case View::Viewer: return viewer_.help(out);
|
||||
case View::Details:
|
||||
out.push_back({"; .", "scroll"});
|
||||
out.push_back({"Enter", "back to the folder"});
|
||||
return;
|
||||
case View::Details: return keys::add(out, keys::kStorageDetails);
|
||||
default: break;
|
||||
}
|
||||
if (dialog_) return help::dialog(out);
|
||||
if (wantList_ || wait_ != Wait::None) return (void)out.push_back({"`", "stop the copy or the delete"});
|
||||
if (view_ == View::Name) return help::textEntry(out, renaming_ ? "rename it" : "make the folder");
|
||||
help::list(out, "open the folder or the file");
|
||||
out.push_back({", /", "a page up, down"});
|
||||
out.push_back({"c x", "copy, cut"});
|
||||
out.push_back({"v", "paste here"});
|
||||
out.push_back({"r", "rename"});
|
||||
out.push_back({"d Del", "delete, after asking"});
|
||||
out.push_back({"n", "a new folder"});
|
||||
out.push_back({"i", "details: size, date, type"});
|
||||
out.push_back({"s", "sort: name, date, size"});
|
||||
out.push_back({"m", "Maintenance: clean-up, erase"});
|
||||
out.push_back({"`", "the folder above"});
|
||||
if (dialog_) return keys::add(out, keys::kDialog);
|
||||
if (wantList_ || wait_ != Wait::None) return keys::add(out, keys::kStorageBusy);
|
||||
if (view_ == View::Name) return keys::add(out, keys::kStorageName);
|
||||
keys::add(out, keys::kStorage);
|
||||
}
|
||||
|
||||
const char* StorageApp::helpTitle() const {
|
||||
|
||||
Reference in New Issue
Block a user