Connect Almanac UI to revision-bound career history (by Codex)

This commit is contained in:
Codex committed 2026-10-28 19:08:42 +01:00
1 parent 4b6c18f654
commit 959154c3c0
18 files changed
+405 -44

No files matched your search

+10
View File
@@ -428,6 +428,16 @@ cli::Json ui_read(const ModernState& g, const UiContext& c, const cli::Json& req
if (kind == "session") return snapshot(request_id, std::move(m), session_data(g, c));
if (kind == "desktop") return snapshot(request_id, std::move(m), desktop_data(g, c, today));
if (kind == "camps") return snapshot(request_id, std::move(m), camps_data(g, c, std::to_string(c.state_revision)));
if (kind == "almanac") {
const J* query = field(request, "query");
if (!query || !query->object())
return failure(request_id, "invalid_almanac_request", "Eine Almanachabfrage wird benötigt.", c.state_revision);
J result = query_almanac(g, *query);
const J* ok = field(result, "ok");
if (!ok || !std::holds_alternative<bool>(ok->value) || !std::get<bool>(ok->value))
return failure(request_id, text_field(result, "error").c_str(), "Der Spielarchiv-Eintrag ist nicht verfügbar.", c.state_revision);
return snapshot(request_id, std::move(m), O{{"kind", "almanac"}, {"query", *query}, {"result", std::move(result)}});
}
if (kind == "news") {
// the press events of a team (teamId, default the desk's team) from `from` to `until` (ISO,
// default everything up to today), newest last, at most `limit` (default 50) of the newest