Public Access
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
52 lines
1.5 KiB
C++
52 lines
1.5 KiB
C++
#pragma once
|
|
|
|
#include <memory>
|
|
#include <vector>
|
|
|
|
#include "cleanup_plan.h"
|
|
#include "dialog_model.h"
|
|
#include "key_help.h"
|
|
#include "event_bus.h"
|
|
#include "key_event.h"
|
|
#include "list_model.h"
|
|
#include "services/clock_service.h"
|
|
#include "services/storage_service.h"
|
|
#include "ui/canvas.h"
|
|
#include "ui/theme.h"
|
|
|
|
namespace roro {
|
|
|
|
// Storage → Maintenance: card usage, Storage Clean-up (category → age → confirm) and erasing the card.
|
|
class MaintenancePage {
|
|
public:
|
|
MaintenancePage(StorageService& storage, ClockService& clock, EventBus& bus)
|
|
: storage_(storage), clock_(clock), bus_(bus) {}
|
|
|
|
void enter();
|
|
bool onKey(const KeyEvent& e); // false: leave the page
|
|
void draw(Canvas& c);
|
|
void help(std::vector<KeyHelp>& out) const;
|
|
|
|
private:
|
|
enum class View { Main, Categories, Ages };
|
|
enum Row { kCard, kLogs, kCaptures, kCleanUp, kErase, kRows };
|
|
|
|
CleanupPlan planFor(int age) const;
|
|
uint64_t categoryBytes(int category) const;
|
|
void warn(const char* text);
|
|
|
|
StorageService& storage_;
|
|
ClockService& clock_;
|
|
EventBus& bus_;
|
|
View view_ = View::Main;
|
|
ListModel main_{theme::kContent.h / theme::kLineHeight};
|
|
ListModel categories_{theme::kContent.h / theme::kLineHeight};
|
|
ListModel ages_{theme::kContent.h / theme::kLineHeight};
|
|
std::vector<std::vector<StoredFile>> listing_;
|
|
bool haveListing_ = false;
|
|
std::unique_ptr<DialogModel> dialog_;
|
|
CleanupPlan pending_;
|
|
};
|
|
|
|
} // namespace roro
|