Pin only pushed commits, with no local overrides: Ziran v0.5.0 (f9f92b46), Kryon b45cc524 (one lock entry, ref master, shared with the Css and Plot master edges), Apps 352901e, Entity b30dd4a and practices 893e5b6f, whose sharpened banners and regenerated Lumi guide clips the narration check now matches. The Library opens each Tao Te Ching chapter on its own picture page: the chapter art and its title, centered together; the text pages follow. The reader keeps the picture page across reflow, and a chapter start or a Contents pick opens it. The 81 approved chapter pictures are included. Breeze now uses Kryon's namespaced widgets (Text.Draw/Text.Props, Button, Image, Modal.ActionModal, Layout, TabBar, LoadingScreen, LoadingIndicator, Shape.Circle) instead of the removed Kryon/Widgets facades. Hosted apps import std/text explicitly, since a short "text" import now names Kryon's widget. AGENTS.md and the Text/Button API checks describe the namespaced forms; two unused test doubles are removed. Build fixes for the new toolchain: the bundle runtime carries Ziran's instruction engine (no BOOTSTRAP=1) and takes the pinned host zi2c for cross builds; the Apps controller's lock context has the manifest's module roots; the app codec generator lists Kryon's raw modules only; the package scripts read ZX revision 28 bundle assets. The Apps controller digest matches the Apps 352901e build. Also included: the stopped lanes' work in this tree (Radio download, Photos install, Lists, Lumi, Habits shop rewards, astral exercise selection, appearance and download recovery) and the raylib-free desktop lane's host modules (app_trace, host_input, host_window, host_clock), inactive unless DESKTOP_HOST is defined. Not included: the crash-recovery lane's picture-window and storage crash-safety changes, which that lane commits itself. Local tests: zi-check (510 modules), native and Android source checks, hosted app checks, build-laws, clean-text-api-check, button-api-check, library-reader-test, library-ui-test, storage-crash-zi-test and native-image-decode-test pass. The bundled Arcade is still ZX revision 26 and waits for an Arcade build on these pins.
179 lines
5.1 KiB
C
179 lines
5.1 KiB
C
#include "app_nav_state.h"
|
|
#include "zir_string.h"
|
|
|
|
#include <assert.h>
|
|
#include <string.h>
|
|
|
|
static int account_present;
|
|
static const char *account_alias;
|
|
static const char *public_key;
|
|
static int public_key_reads;
|
|
static const char public_id[] =
|
|
"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef";
|
|
|
|
int32_t sync_account_load(AccountKeys *account)
|
|
{
|
|
(void)account;
|
|
assert(0 && "Navigation must not load private account keys");
|
|
return 0;
|
|
}
|
|
|
|
String storage_get_setting_text(String key)
|
|
{
|
|
if (StringEqual(key, StringView("sync_public_id", 14)))
|
|
return StringView(public_id, account_present ? sizeof(public_id) - 1 : 0);
|
|
if (StringEqual(key, StringView("sync_public_key", 15))) {
|
|
public_key_reads++;
|
|
return StringView(public_key, strlen(public_key));
|
|
}
|
|
assert(StringEqual(key, StringView("sync_account_alias", 18)));
|
|
return StringView(account_alias, strlen(account_alias));
|
|
}
|
|
|
|
String LocaleText(String key)
|
|
{
|
|
assert(StringEqual(key, StringView("tab_profile", 11)));
|
|
return StringView("Profile", 7);
|
|
}
|
|
|
|
bool AppMiniMode(void)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
bool node_apps_NodeAppImmersive(int32_t slot)
|
|
{
|
|
(void)slot;
|
|
return false;
|
|
}
|
|
|
|
String node_apps_NodeAppName(int32_t slot)
|
|
{
|
|
(void)slot;
|
|
return StringView("", 0);
|
|
}
|
|
|
|
String app_records_NodeAppReplacement(String name)
|
|
{
|
|
(void)name;
|
|
return StringView("", 0);
|
|
}
|
|
|
|
int32_t route_types_AppNavNodeSlot(int32_t route)
|
|
{
|
|
(void)route;
|
|
return -1;
|
|
}
|
|
|
|
int32_t route_types_AppNavNodeRoute(int32_t slot)
|
|
{
|
|
(void)slot;
|
|
return 0;
|
|
}
|
|
|
|
int32_t AppsInstalledMask(void)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
int32_t DesktopPlatform(void)
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
bool IsDesktopWidth(int32_t view_width, float scale)
|
|
{
|
|
(void)view_width;
|
|
(void)scale;
|
|
return true;
|
|
}
|
|
|
|
int32_t AppScale(int32_t pixels)
|
|
{
|
|
return pixels;
|
|
}
|
|
|
|
/* A Practice tab switch keeps the left rail and Practice highlighted, so the
|
|
* page beside it never moves sideways. */
|
|
static void check_practice_tabs_keep_rail(void)
|
|
{
|
|
static InnerBreeze app;
|
|
const int32_t tabs[] = {PRACTICE_TAB_PLAY, PRACTICE_TAB_MANUAL,
|
|
PRACTICE_TAB_CONFIG, PRACTICE_TAB_PLAY};
|
|
memset(&app, 0, sizeof(app));
|
|
app.navigation_placement = NavigationPlacement_NAVIGATION_LEFT;
|
|
app.ui.navigation_height = 720;
|
|
app.ui.view_width = 900;
|
|
app.breathing.screen = ScreenStart;
|
|
app.main_tab = AppMainTab_APP_MAIN_TAB_PRACTICE;
|
|
for (size_t i = 0; i < sizeof(tabs) / sizeof(tabs[0]); i++) {
|
|
app.practice_tab = tabs[i];
|
|
assert(app_nav_desktop_rail_enabled(&app) == 1);
|
|
assert(app_navigation_height(&app) == 0);
|
|
assert(app_current_nav_route(&app) == AppNavRoute_APP_NAV_ROUTE_PRACTICE);
|
|
}
|
|
}
|
|
|
|
String AppTextFromCString(uint8_t *data, int32_t capacity)
|
|
{
|
|
int32_t length = 0;
|
|
while (length < capacity && data[length] != 0)
|
|
length++;
|
|
return StringView((const char *)data, (size_t)length);
|
|
}
|
|
|
|
int main(void)
|
|
{
|
|
static InnerBreeze app;
|
|
uint8_t name[64];
|
|
uint8_t subtitle[64];
|
|
uint8_t small[5];
|
|
Slice out = {name, sizeof(name)};
|
|
Slice sub = {subtitle, sizeof(subtitle)};
|
|
memset(&app, 0, sizeof(app));
|
|
|
|
check_practice_tabs_keep_rail();
|
|
app_reset_bottom_nav_routes(&app);
|
|
assert(app.bottom_nav_route_count == 4);
|
|
assert(app.bottom_nav_routes[0] == AppNavRoute_APP_NAV_ROUTE_LUMI);
|
|
assert(app.bottom_nav_routes[1] == AppNavRoute_APP_NAV_ROUTE_HABITS);
|
|
assert(app.bottom_nav_routes[2] == AppNavRoute_APP_NAV_ROUTE_PRACTICE);
|
|
assert(app.bottom_nav_routes[3] == AppNavRoute_APP_NAV_ROUTE_SETTINGS);
|
|
account_present = 0;
|
|
account_alias = "";
|
|
public_key = "fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876549876";
|
|
app_nav_profile_identity(&app, out, sizeof(name), sub, sizeof(subtitle));
|
|
assert(strcmp((char *)name, "Profile") == 0);
|
|
assert(subtitle[0] == 0);
|
|
|
|
account_present = 1;
|
|
account_alias = "nara";
|
|
app_nav_profile_identity(&app, out, sizeof(name), sub, sizeof(subtitle));
|
|
assert(strcmp((char *)name, "nara") == 0);
|
|
assert(strcmp((char *)subtitle, "@nara") == 0);
|
|
|
|
memcpy(app.profile_display_name, "Breeze", 7);
|
|
app_nav_profile_identity(&app, out, sizeof(name), sub, sizeof(subtitle));
|
|
assert(strcmp((char *)name, "nara") == 0);
|
|
assert(strcmp((char *)subtitle, "@nara") == 0);
|
|
assert(public_key_reads == 0);
|
|
|
|
account_alias = "";
|
|
app_nav_profile_identity(&app, out, sizeof(name), sub, sizeof(subtitle));
|
|
assert(strcmp((char *)name, "fedc...9876") == 0);
|
|
assert(strcmp((char *)subtitle, "Profile") == 0);
|
|
|
|
app_nav_profile_identity(&app, (Slice){small, sizeof(small)}, 5,
|
|
sub, sizeof(subtitle));
|
|
assert(strcmp((char *)small, "fedc") == 0);
|
|
|
|
/* Delegated/older profiles may retain only the public account ID. */
|
|
public_key = "";
|
|
app_nav_profile_identity(&app, out, sizeof(name), sub, sizeof(subtitle));
|
|
assert(strcmp((char *)name, "0123...cdef") == 0);
|
|
account_present = 0;
|
|
app_nav_profile_identity(&app, out, sizeof(name), sub, sizeof(subtitle));
|
|
assert(strcmp((char *)name, "Profile") == 0);
|
|
return 0;
|
|
}
|