Public Access
Help: Fn+h lists the keys of the screen you're on, and no screen names its keys any more (#69)
Fn+h on any screen, text fields included, and ? outside Text Entry, open a panel over the content area: the screen's own keys, then the ones that work everywhere. Every App declares its keys for the state it is in (pages, viewers, dialogs and text fields answer for themselves); the App manager opens the panel and takes every key while it is open. About 30 hint lines are gone, from every App. What stays on a screen is state. The first-start Setup keeps its hints and teaches the key; a device set up before gets one Toast, once. The guide and the FAQ open with it. `key help` over the consoles. 476 host tests (8 new). Checked on the device with key help and screenshots: the Launcher, all nine Apps and several of their states. 8.5 KB of flash and 40 bytes of static RAM. Decisions Q196 to Q203 in docs/milestones/U1.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EhqxQ49eCju4CzKYNjZzwT
This commit is contained in:
@@ -199,7 +199,7 @@ void StorageApp::onFinished(const FileOps::Status& s) {
|
||||
}
|
||||
|
||||
void StorageApp::paste(bool replace) {
|
||||
if (!clip_) return say("Nothing to paste: c copies, x cuts");
|
||||
if (!clip_) return say("Nothing to paste: copy or cut something first");
|
||||
std::string name = baseName(clip_.path), why;
|
||||
if (cut_) {
|
||||
why = ops_.move(clip_.path, clip_.folder, joinPath(cwd_, name), replace);
|
||||
@@ -273,6 +273,45 @@ void StorageApp::showDetails(const Item& item) {
|
||||
view_ = View::Details;
|
||||
}
|
||||
|
||||
void StorageApp::help(std::vector<KeyHelp>& out) const {
|
||||
switch (view_) {
|
||||
case View::NoMemory: return;
|
||||
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;
|
||||
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"});
|
||||
}
|
||||
|
||||
const char* StorageApp::helpTitle() const {
|
||||
switch (view_) {
|
||||
case View::Maintenance: return "Storage: maintenance";
|
||||
case View::Editor: return "Storage: the editor";
|
||||
case View::Viewer: return "Storage: a file";
|
||||
case View::Details: return "Storage: details";
|
||||
case View::Name: return "Storage: a name";
|
||||
default: return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
bool StorageApp::onKey(const KeyEvent& e) {
|
||||
requestRedraw();
|
||||
if (view_ == View::NoMemory) return false;
|
||||
@@ -434,7 +473,7 @@ bool StorageApp::onBrowseKey(const KeyEvent& e) {
|
||||
if (ch == 'c') {
|
||||
clip_ = item;
|
||||
cut_ = false;
|
||||
say("v pastes a copy of " + name);
|
||||
say("Copied " + name + ": paste it where you like");
|
||||
return true;
|
||||
}
|
||||
// Cut, rename and delete change the original: the rules of Q130 first.
|
||||
@@ -446,7 +485,7 @@ bool StorageApp::onBrowseKey(const KeyEvent& e) {
|
||||
if (ch == 'x') {
|
||||
clip_ = item;
|
||||
cut_ = true;
|
||||
say("v moves " + name + " here");
|
||||
say("Cut " + name + ": paste it where it should go");
|
||||
} else if (ch == 'r') {
|
||||
target_ = item;
|
||||
renaming_ = true;
|
||||
@@ -542,7 +581,6 @@ void StorageApp::drawBrowse(Canvas& c) {
|
||||
} else if (rows_.count() == 0) {
|
||||
c.setTextColor(theme::kMuted);
|
||||
c.drawString("Nothing in this folder.", 4, rows.y + 4);
|
||||
c.drawString("n makes a folder, v pastes.", 4, rows.y + 4 + theme::kLineHeight);
|
||||
} else {
|
||||
int entries = static_cast<int>(list_.count());
|
||||
auto value = [&](int i) {
|
||||
@@ -558,13 +596,13 @@ void StorageApp::drawBrowse(Canvas& c) {
|
||||
value);
|
||||
}
|
||||
|
||||
// Footer: a message for a few seconds, what v would paste, or the keys.
|
||||
// Footer: a message for a few seconds, or what a paste would do. Never the keys (Fn+h).
|
||||
c.setFont(&fonts::small);
|
||||
bool showMessage = !message_.empty() && millis() - messageMs_ < kMessageMs;
|
||||
c.setTextColor(showMessage ? theme::kWarning : theme::kMuted);
|
||||
std::string keys = "c x v:paste r:name d:del n:new i:info s:sort";
|
||||
std::string keys;
|
||||
if ((wantList_ || wait_ == Wait::List) && millis() - waitSinceMs_ >= kQuietMs) keys = "Reading " + files::fitName(want_, 30) + "...";
|
||||
else if (clip_) keys = std::string("v: ") + (cut_ ? "move " : "copy ") + files::fitName(baseName(clip_.path), 20) + " here";
|
||||
else if (clip_) keys = std::string(cut_ ? "Cut: " : "Copied: ") + files::fitName(baseName(clip_.path), 28);
|
||||
c.drawString(showMessage ? message_.c_str() : keys.c_str(), 4, area.y + area.h - 9);
|
||||
}
|
||||
|
||||
@@ -589,8 +627,6 @@ void StorageApp::drawProgress(Canvas& c) {
|
||||
line = formatBytes(s.doneBytes) + " of " + formatBytes(s.totalBytes);
|
||||
}
|
||||
c.drawString(line.c_str(), box.x + 6, box.y + 31);
|
||||
c.setFont(&fonts::small);
|
||||
c.drawString("Back: cancel", box.x + 6, box.y + box.h - 10);
|
||||
}
|
||||
|
||||
} // namespace roro
|
||||
|
||||
Reference in New Issue
Block a user