feat(runtime): expose canGoBack for firmware chrome

Firmware needs to know whether a back control would go anywhere, and the
history that answers it belongs to the runtime.
This commit is contained in:
2026-08-03 17:53:27 -04:00
parent 95fa512047
commit d53f9b77cd
+3
View File
@@ -70,6 +70,9 @@ class Runtime {
void requestLaunch(const std::string& path, const std::string& arg, bool replace);
void requestBack();
bool hasPendingNavigation() const { return pending_.kind != Pending::None; }
// Whether sys.back() would return somewhere rather than land on the launcher, which is what
// firmware chrome needs to decide whether to offer a back control.
bool canGoBack() const { return !history_.empty(); }
// Loads whatever was requested. False means the app failed to start or history ran out at the
// launcher, in which case no app is running.
bool applyPendingNavigation();