Give the Results test the real leaderboard screen instead of a stub

Since Profile hosts the leaderboard, entity_host links the leaderboard
screen, so session-results-zi-test defined leaderboard_screen_enter twice.
The Results test now uses the real screen with a stub for the habit
editor's leave check, and only the tests that do not link the screen keep
its stub. This replaces a79ab2ac's foreign call from Profile, whose web
build ended release-ready's music test on Habits instead of Settings; the
app sources are those of 7ccb904f again.
This commit is contained in:
waozi committed 2026-10-27 04:21:49 -03:00
1 parent 87c9cd30a2
commit 66824eba50
8 files changed
+21 -20

No files matched your search

+1 -3
View File
@@ -3,6 +3,7 @@
Entity :: #import "entity/model";
#import "entity/dew_model"
#import "entity/leaderboard_model"
#import, file "../screens/leaderboard_screen.zi";
Provider :: #import "entity/native_management";
#import "kryon/app_context_host"
Portable :: #import "kryon/app_protocol";
@@ -44,9 +45,6 @@ Shared :: #import "entity/native_files";
// A profile reads the host's busy flag without importing the sync engine.
c :: #system_library "c";
EntitySyncLoading :: () -> s32 #foreign c "app_sync_loading";
// Profile's leaderboard boards come from the leaderboard screen, a separate
// translation unit, so the shared navigation does not link every screen.
InbeLeaderboardSnapshot :: (app: *InnerBreeze, request: string) -> string #foreign c;
entity_context: AppContext;
entity_opened: bool;
-1
View File
@@ -574,7 +574,6 @@ LeaderboardUiCall :: (context: *void, module: *u8, function: *u8,
leaderboard_projection: string;
EntityHostOpenLeaderboard :: () #foreign c;
#program_export
InbeLeaderboardSnapshot :: (app: *InnerBreeze, request: string) -> string {
page: ProfileLeaderboard
account: AccountKeys
-13
View File
@@ -17,19 +17,6 @@ host_load_friends_cache :: (app: *void) {
unused app
}
#program_export "leaderboard_screen_enter"
host_enter_leaderboard :: (app: *void) {
unused app
}
// No practice leaderboards in these tests.
#program_export "InbeLeaderboardSnapshot"
host_leaderboard_snapshot :: (app: *void, request: string) -> string {
unused app
unused request
return ""
}
#program_export "node_app_screen_enter"
host_enter_node_app :: (app: *void) {
unused app
+9
View File
@@ -0,0 +1,9 @@
// The habit editor's leave check, for tests that reach navigation without
// linking the editor: leaving is always allowed.
#program_export "habit_edit_request_leave"
host_habit_edit_request_leave :: (app: *void, route: s32) -> bool {
unused app
unused route
return true
}
+1 -1
View File
@@ -21,7 +21,7 @@ mkdir -p "$work/generated"
--module-path "$root/build/packages/daochi-client" \
--entry habit_form_behavior:Check \
-o "$work/generated" "$root/tests/habit_form_behavior.zi" \
"$root/tests/sync_test_host.zi" "$root/tests/app_hooks_host.zi"
"$root/tests/sync_test_host.zi" "$root/tests/app_hooks_host.zi" "$root/tests/leaderboard_hooks_host.zi"
cat > "$work/generated/main.c" <<'C'
#include "habit_form_behavior.h"
#include <stdio.h>
+1 -1
View File
@@ -22,7 +22,7 @@ mkdir -p "$work/generated"
--entry habit_sessions_behavior:Check \
-o "$work/generated" "$root/tests/habit_sessions_behavior.zi" \
"$root/tests/sync_test_host.zi" \
"$root/tests/app_hooks_host.zi"
"$root/tests/app_hooks_host.zi" "$root/tests/leaderboard_hooks_host.zi"
cat > "$work/generated/main.c" <<'C'
#include "habit_sessions_behavior.h"
#include <stdio.h>
+8
View File
@@ -0,0 +1,8 @@
// The leaderboard route, for tests whose program does not link the
// leaderboard screen. Profile's host links it, so tests that reach Profile
// use the real one.
#program_export "leaderboard_screen_enter"
host_enter_leaderboard :: (app: *void) {
unused app
}
+1 -1
View File
@@ -21,7 +21,7 @@ mkdir -p "$work/generated"
--module-path "$root/build/packages/daochi-client" \
--entry session_results_behavior:Check \
-o "$work/generated" "$root/tests/session_results_behavior.zi" \
"$root/tests/app_hooks_host.zi" "$root/tests/clock_host.zi"
"$root/tests/app_hooks_host.zi" "$root/tests/habit_edit_hooks_host.zi" "$root/tests/clock_host.zi"
cat > "$work/generated/main.c" <<'C'
#include "session_results_behavior.h"
#include <stdio.h>