Move Inner Breeze leaderboard into the shared Profile
This commit is contained in:
1 parent
bdf5fcee7a
commit
bc55cc6241
24 files changed
+275
-132
No files matched your search
@@ -34,6 +34,8 @@ account to sync across devices.
|
|||||||
changing your app. Offline commands work without an AI connection.
|
changing your app. Offline commands work without an AI connection.
|
||||||
- **Your apps:** arrange Apps as a list or grid, choose colours and icons,
|
- **Your apps:** arrange Apps as a list or grid, choose colours and icons,
|
||||||
listen to ambient Radio, and explore Arcade games and achievements.
|
listen to ambient Radio, and explore Arcade games and achievements.
|
||||||
|
- **Profile:** compare practice and game rankings with friends in Leaderboard.
|
||||||
|
Only installed apps, ranked practices and installed games appear there.
|
||||||
|
|
||||||
## A look inside
|
## A look inside
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"host_api": 38,
|
"host_api": 39,
|
||||||
"oldest_host_api": 12,
|
"oldest_host_api": 12,
|
||||||
"package_format": "zx",
|
"package_format": "zx",
|
||||||
"module_api": 2,
|
"module_api": 2,
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
"version": "2.1.51",
|
"version": "2.1.51",
|
||||||
"sequence": 48,
|
"sequence": 48,
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"host_api": 38,
|
"host_api": 39,
|
||||||
"release": "2.1.51"
|
"release": "2.1.51"
|
||||||
},
|
},
|
||||||
"habits": {
|
"habits": {
|
||||||
|
|||||||
@@ -7497,3 +7497,8 @@ Načítání obrázků
|
|||||||
---
|
---
|
||||||
[app_loading_apps]
|
[app_loading_apps]
|
||||||
Otevírání aplikací
|
Otevírání aplikací
|
||||||
|
|
||||||
|
---
|
||||||
|
[leaderboard_refresh_failed]
|
||||||
|
Žebříček se nepodařilo aktualizovat.
|
||||||
|
---
|
||||||
@@ -7491,3 +7491,8 @@ Bilder werden geladen
|
|||||||
---
|
---
|
||||||
[app_loading_apps]
|
[app_loading_apps]
|
||||||
Apps werden geöffnet
|
Apps werden geöffnet
|
||||||
|
|
||||||
|
---
|
||||||
|
[leaderboard_refresh_failed]
|
||||||
|
Die Rangliste konnte nicht aktualisiert werden.
|
||||||
|
---
|
||||||
@@ -7515,3 +7515,8 @@ Loading pictures
|
|||||||
---
|
---
|
||||||
[app_loading_apps]
|
[app_loading_apps]
|
||||||
Opening apps
|
Opening apps
|
||||||
|
|
||||||
|
---
|
||||||
|
[leaderboard_refresh_failed]
|
||||||
|
Could not refresh the leaderboard.
|
||||||
|
---
|
||||||
@@ -7491,3 +7491,8 @@ Cargando imágenes
|
|||||||
---
|
---
|
||||||
[app_loading_apps]
|
[app_loading_apps]
|
||||||
Abriendo aplicaciones
|
Abriendo aplicaciones
|
||||||
|
|
||||||
|
---
|
||||||
|
[leaderboard_refresh_failed]
|
||||||
|
No se pudo actualizar la clasificación.
|
||||||
|
---
|
||||||
@@ -7479,3 +7479,8 @@ Chargement des images
|
|||||||
---
|
---
|
||||||
[app_loading_apps]
|
[app_loading_apps]
|
||||||
Ouverture des applications
|
Ouverture des applications
|
||||||
|
|
||||||
|
---
|
||||||
|
[leaderboard_refresh_failed]
|
||||||
|
Impossible de mettre à jour le classement.
|
||||||
|
---
|
||||||
@@ -7480,3 +7480,8 @@ Memuat gambar
|
|||||||
---
|
---
|
||||||
[app_loading_apps]
|
[app_loading_apps]
|
||||||
Membuka aplikasi-aplikasi
|
Membuka aplikasi-aplikasi
|
||||||
|
|
||||||
|
---
|
||||||
|
[leaderboard_refresh_failed]
|
||||||
|
Papan peringkat tidak dapat diperbarui.
|
||||||
|
---
|
||||||
@@ -7480,3 +7480,8 @@ Caricamento immagini
|
|||||||
---
|
---
|
||||||
[app_loading_apps]
|
[app_loading_apps]
|
||||||
Apertura delle app
|
Apertura delle app
|
||||||
|
|
||||||
|
---
|
||||||
|
[leaderboard_refresh_failed]
|
||||||
|
Impossibile aggiornare la classifica.
|
||||||
|
---
|
||||||
@@ -7476,3 +7476,8 @@ Lumi や日記など、Inner Breeze 内のアプリを waozi.xyz から自動で
|
|||||||
---
|
---
|
||||||
[app_loading_apps]
|
[app_loading_apps]
|
||||||
アプリを読み込み中
|
アプリを読み込み中
|
||||||
|
|
||||||
|
---
|
||||||
|
[leaderboard_refresh_failed]
|
||||||
|
ランキングを更新できませんでした。
|
||||||
|
---
|
||||||
@@ -7486,3 +7486,8 @@ Lumi, 일기 등 Inner Breeze 안의 앱을 waozi.xyz에서 자동으로 업데
|
|||||||
---
|
---
|
||||||
[app_loading_apps]
|
[app_loading_apps]
|
||||||
앱 불러오는 중
|
앱 불러오는 중
|
||||||
|
|
||||||
|
---
|
||||||
|
[leaderboard_refresh_failed]
|
||||||
|
순위표를 새로 고칠 수 없습니다.
|
||||||
|
---
|
||||||
@@ -7489,3 +7489,8 @@ Carregando imagens
|
|||||||
---
|
---
|
||||||
[app_loading_apps]
|
[app_loading_apps]
|
||||||
Abrindo aplicativos
|
Abrindo aplicativos
|
||||||
|
|
||||||
|
---
|
||||||
|
[leaderboard_refresh_failed]
|
||||||
|
Não foi possível atualizar a classificação.
|
||||||
|
---
|
||||||
@@ -7485,3 +7485,8 @@ Inner Breeze обновлён до версии %s.
|
|||||||
---
|
---
|
||||||
[app_loading_apps]
|
[app_loading_apps]
|
||||||
Открытие приложений
|
Открытие приложений
|
||||||
|
|
||||||
|
---
|
||||||
|
[leaderboard_refresh_failed]
|
||||||
|
Не удалось обновить таблицу лидеров.
|
||||||
|
---
|
||||||
@@ -7491,3 +7491,8 @@ Inner Breeze 已更新至 %s 版本。
|
|||||||
---
|
---
|
||||||
[app_loading_apps]
|
[app_loading_apps]
|
||||||
正在打开各个应用
|
正在打开各个应用
|
||||||
|
|
||||||
|
---
|
||||||
|
[leaderboard_refresh_failed]
|
||||||
|
无法刷新排行榜。
|
||||||
|
---
|
||||||
+23
-1
@@ -2,6 +2,8 @@
|
|||||||
// keys and specialized screens behind its native host services.
|
// keys and specialized screens behind its native host services.
|
||||||
Entity :: #import "entity/model";
|
Entity :: #import "entity/model";
|
||||||
#import "entity/dew_model"
|
#import "entity/dew_model"
|
||||||
|
#import "entity/leaderboard_model"
|
||||||
|
#import, file "../screens/leaderboard_screen.zi";
|
||||||
Provider :: #import "entity/native_management";
|
Provider :: #import "entity/native_management";
|
||||||
#import "kryon/app_context_host"
|
#import "kryon/app_context_host"
|
||||||
Portable :: #import "kryon/app_protocol";
|
Portable :: #import "kryon/app_protocol";
|
||||||
@@ -51,6 +53,7 @@ entity_inner_breeze: bool;
|
|||||||
entity_reload_after_route: bool;
|
entity_reload_after_route: bool;
|
||||||
entity_account_route: bool;
|
entity_account_route: bool;
|
||||||
entity_snapshot: string;
|
entity_snapshot: string;
|
||||||
|
entity_leaderboard_route: bool;
|
||||||
|
|
||||||
InbeEntityRead :: (app: *InnerBreeze) -> string {
|
InbeEntityRead :: (app: *InnerBreeze) -> string {
|
||||||
Entity.EntityFree(entity_document)
|
Entity.EntityFree(entity_document)
|
||||||
@@ -138,7 +141,7 @@ EntityHostAllows :: (context: *void, name: string) -> bool {
|
|||||||
return name == "ReadStoreHost" || name == "WriteStoreHost" ||
|
return name == "ReadStoreHost" || name == "WriteStoreHost" ||
|
||||||
name == "AppLocaleHost" || name == "ClipboardCopyHost" ||
|
name == "AppLocaleHost" || name == "ClipboardCopyHost" ||
|
||||||
name == "AppServiceHost" || name == "entity.management" || name == "entity.text_height" ||
|
name == "AppServiceHost" || name == "entity.management" || name == "entity.text_height" ||
|
||||||
name == "entity.achievements" || name == "entity.activity" || (name == "entity.dew" && DewAvailable())
|
name == "entity.achievements" || name == "entity.activity" || name == LEADERBOARD_SERVICE || (name == "entity.dew" && DewAvailable())
|
||||||
}
|
}
|
||||||
|
|
||||||
// The node-confirmed Dew account and Inner Breeze's own summaries for the
|
// The node-confirmed Dew account and Inner Breeze's own summaries for the
|
||||||
@@ -245,6 +248,10 @@ EntityHostText :: (text: string) -> HostValue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
EntityHostLocale :: (key: string) -> string {
|
EntityHostLocale :: (key: string) -> string {
|
||||||
|
if key == "leaderboard_title" || key == "leaderboard_refresh_failed" || key == "profile_friends_title" ||
|
||||||
|
key == "profile_no_leaderboard_data" || key == "profile_updating_status" {
|
||||||
|
return LocaleText(key)
|
||||||
|
}
|
||||||
if key == "achievements_title" || (key.count >= 12 && key[:12] == "achievement_") {
|
if key == "achievements_title" || (key.count >= 12 && key[:12] == "achievement_") {
|
||||||
return LocaleText(key)
|
return LocaleText(key)
|
||||||
}
|
}
|
||||||
@@ -310,6 +317,10 @@ EntityHostCall :: (context: *void, module: *u8, function: *u8,
|
|||||||
arguments: *HostValue, count: s32, result: *HostValue) -> s32 {
|
arguments: *HostValue, count: s32, result: *HostValue) -> s32 {
|
||||||
app := cast(*InnerBreeze)context
|
app := cast(*InnerBreeze)context
|
||||||
name := TextFromCString(function)
|
name := TextFromCString(function)
|
||||||
|
if name == "AppServiceHost" && count == 2 && AppArgumentText(arguments[0]) == LEADERBOARD_SERVICE {
|
||||||
|
result.* = EntityHostText(InbeLeaderboardSnapshot(app, AppArgumentText(arguments[1])))
|
||||||
|
return 1
|
||||||
|
}
|
||||||
if AchievementEntityCall(cast(*void)app, name, arguments, count, result) {
|
if AchievementEntityCall(cast(*void)app, name, arguments, count, result) {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
@@ -396,6 +407,11 @@ EntityHostFrame :: (app: *InnerBreeze, bounds: Rectangle) -> bool {
|
|||||||
unused AppContextRun(*entity_context, Portable.APP_COMMAND)
|
unused AppContextRun(*entity_context, Portable.APP_COMMAND)
|
||||||
}
|
}
|
||||||
entity_account_route = account_route
|
entity_account_route = account_route
|
||||||
|
if entity_leaderboard_route {
|
||||||
|
entity_context.command = "leaderboard"
|
||||||
|
unused AppContextRun(*entity_context, Portable.APP_COMMAND)
|
||||||
|
entity_leaderboard_route = false
|
||||||
|
}
|
||||||
entity_context.session = app.ui.session
|
entity_context.session = app.ui.session
|
||||||
entity_context.bounds = bounds
|
entity_context.bounds = bounds
|
||||||
entity_context.dark = app.dark_mode != 0
|
entity_context.dark = app.dark_mode != 0
|
||||||
@@ -457,4 +473,10 @@ EntityHostReset :: () {
|
|||||||
entity_inner_breeze = false
|
entity_inner_breeze = false
|
||||||
entity_account_route = false
|
entity_account_route = false
|
||||||
entity_reload_after_route = true
|
entity_reload_after_route = true
|
||||||
|
entity_leaderboard_route = false
|
||||||
|
}
|
||||||
|
|
||||||
|
#program_export
|
||||||
|
EntityHostOpenLeaderboard :: () {
|
||||||
|
entity_leaderboard_route = true
|
||||||
}
|
}
|
||||||
@@ -7,19 +7,19 @@ using AppNavRoute;
|
|||||||
|
|
||||||
// Storage follows the app catalog; there is no separate favorites quota.
|
// Storage follows the app catalog; there is no separate favorites quota.
|
||||||
// The bundled apps, then one route for each slot of an app the node offers.
|
// The bundled apps, then one route for each slot of an app the node offers.
|
||||||
LAUNCHER_APP_COUNT :: 14
|
LAUNCHER_APP_COUNT :: 13
|
||||||
|
|
||||||
LauncherRoutes :: () -> [LAUNCHER_APP_COUNT]s32 {
|
LauncherRoutes :: () -> [LAUNCHER_APP_COUNT]s32 {
|
||||||
// Leaderboard comes last of the bundled apps, so adding it moved none.
|
// The leaderboard belongs to the permanent Profile control.
|
||||||
return .{APP_NAV_ROUTE_DIARY, APP_NAV_ROUTE_HABITS,
|
return .{APP_NAV_ROUTE_DIARY, APP_NAV_ROUTE_HABITS,
|
||||||
APP_NAV_ROUTE_ELIST, APP_NAV_ROUTE_LUMI, APP_NAV_ROUTE_PRACTICE,
|
APP_NAV_ROUTE_ELIST, APP_NAV_ROUTE_LUMI, APP_NAV_ROUTE_PRACTICE,
|
||||||
APP_NAV_ROUTE_LEADERBOARD, AppNavNodeRoute(0), AppNavNodeRoute(1),
|
AppNavNodeRoute(0), AppNavNodeRoute(1),
|
||||||
AppNavNodeRoute(2), AppNavNodeRoute(3), AppNavNodeRoute(4),
|
AppNavNodeRoute(2), AppNavNodeRoute(3), AppNavNodeRoute(4),
|
||||||
AppNavNodeRoute(5), AppNavNodeRoute(6), AppNavNodeRoute(7)}
|
AppNavNodeRoute(5), AppNavNodeRoute(6), AppNavNodeRoute(7)}
|
||||||
}
|
}
|
||||||
|
|
||||||
// A new profile pins Lumi, Habits and Practice in this order. Lists and
|
// A new profile pins Lumi, Habits and Practice in this order. Lists and
|
||||||
// Leaderboard are also preinstalled and appear below the pinned section.
|
// Diary are also preinstalled and appear below the pinned section.
|
||||||
LauncherDefaults :: (routes: []s32) -> s32 {
|
LauncherDefaults :: (routes: []s32) -> s32 {
|
||||||
defaults: [3]s32 = .{APP_NAV_ROUTE_LUMI,
|
defaults: [3]s32 = .{APP_NAV_ROUTE_LUMI,
|
||||||
APP_NAV_ROUTE_HABITS, APP_NAV_ROUTE_PRACTICE}
|
APP_NAV_ROUTE_HABITS, APP_NAV_ROUTE_PRACTICE}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// Generated from apps/versions.json. This host runs packages built for host
|
// Generated from apps/versions.json. This host runs packages built for host
|
||||||
// interfaces from the oldest to the current one; module interfaces must match.
|
// interfaces from the oldest to the current one; module interfaces must match.
|
||||||
PackageHostAPI :: 38
|
PackageHostAPI :: 39
|
||||||
PackageHostAPIOldest :: 12
|
PackageHostAPIOldest :: 12
|
||||||
PackageModuleAPI :: 2
|
PackageModuleAPI :: 2
|
||||||
@@ -380,6 +380,17 @@ NodeInstalledVisible :: (entry: *NodeInstalledLeaf) -> bool {
|
|||||||
return NodeTreeState(null, NodeTreeAccount(), *entry.identity, *state) && state.installed
|
return NodeTreeState(null, NodeTreeAccount(), *entry.identity, *state) && state.installed
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// A retained game score does not prove its app is still installed.
|
||||||
|
NodeAppInstalledIdentity :: (root: string, id: string) -> bool {
|
||||||
|
for entry: node_installed_leaves {
|
||||||
|
if TextUntilNul(entry.root[:]) == root && TextUntilNul(entry.identity.id[:]) == id &&
|
||||||
|
NodeInstalledVisible(*entry) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
// Keep independent verified copies for each installed root, and project one
|
// Keep independent verified copies for each installed root, and project one
|
||||||
// visible definition per identity. Removing one root never hides another.
|
// visible definition per identity. Removing one root never hides another.
|
||||||
NodeInstalledRepresentative :: (at: s64) -> bool {
|
NodeInstalledRepresentative :: (at: s64) -> bool {
|
||||||
|
|||||||
@@ -59,6 +59,8 @@ using HostValueKind;
|
|||||||
// its own instance and never overwrites a live slot or persists its handles.
|
// its own instance and never overwrites a live slot or persists its handles.
|
||||||
node_tree_hosts: [NodeAppSlots * 2]AppHost;
|
node_tree_hosts: [NodeAppSlots * 2]AppHost;
|
||||||
node_tree_validating: bool;
|
node_tree_validating: bool;
|
||||||
|
node_tree_profile_requested: bool;
|
||||||
|
node_tree_profile_account: [65]u8;
|
||||||
node_tree_widget_node: *AppNode;
|
node_tree_widget_node: *AppNode;
|
||||||
NodeTreeImage :: struct {
|
NodeTreeImage :: struct {
|
||||||
path: string
|
path: string
|
||||||
@@ -164,7 +166,7 @@ NodeTreeAllows :: (context: *void, node: *AppNode, name: string) -> bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if name == "AppServiceHost" || name == "entity.records" || name == "entity.dew" || name == PublicationsService || name == "leaderboard" ||
|
if name == "AppServiceHost" || name == "entity.records" || name == "entity.dew" || name == PublicationsService || name == "leaderboard" ||
|
||||||
name == "arcade.navigation" || name == "tile_map.sampling" { return true }
|
name == "arcade.navigation" || name == "entity.profile" || name == "tile_map.sampling" { return true }
|
||||||
if name == "AppRecordHost" || name == "SaveAppRecordHost" || name == "AppLocaleHost" ||
|
if name == "AppRecordHost" || name == "SaveAppRecordHost" || name == "AppLocaleHost" ||
|
||||||
name == "SmoothFramesHost" || name == "ClipboardCopyHost" || name == "ReadStoreHost" ||
|
name == "SmoothFramesHost" || name == "ClipboardCopyHost" || name == "ReadStoreHost" ||
|
||||||
name == "WriteStoreHost" || name == "AppNowHost" || name == "AppLocalOffsetHost" ||
|
name == "WriteStoreHost" || name == "AppNowHost" || name == "AppLocalOffsetHost" ||
|
||||||
@@ -193,6 +195,12 @@ NodeTreeCall :: (context: *void, node: *AppNode, module: *u8, function: *u8,
|
|||||||
}
|
}
|
||||||
if name == "AppServiceHost" && count == 2 && HostScalarValid(arguments[0], "string", cast(s32)HostString) &&
|
if name == "AppServiceHost" && count == 2 && HostScalarValid(arguments[0], "string", cast(s32)HostString) &&
|
||||||
HostScalarValid(arguments[1], "string", cast(s32)HostString) {
|
HostScalarValid(arguments[1], "string", cast(s32)HostString) {
|
||||||
|
if AppArgumentText(arguments[0]) == "entity.profile" && AppArgumentText(arguments[1]) == "open" &&
|
||||||
|
!node_tree_validating && !node_snapshot_scanning {
|
||||||
|
node_tree_profile_requested = CopyCString(NodeTreeAccount(), node_tree_profile_account[:])
|
||||||
|
result.* = NodeAppString(ifx node_tree_profile_requested then "queued" else "unavailable")
|
||||||
|
return 1
|
||||||
|
}
|
||||||
if AppArgumentText(arguments[0]) == "arcade.navigation" && AppArgumentText(arguments[1]) == "back" &&
|
if AppArgumentText(arguments[0]) == "arcade.navigation" && AppArgumentText(arguments[1]) == "back" &&
|
||||||
!node_tree_validating && !node_snapshot_scanning && runner.nested != null {
|
!node_tree_validating && !node_snapshot_scanning && runner.nested != null {
|
||||||
// Queue the parent transition until the guest frame returns.
|
// Queue the parent transition until the guest frame returns.
|
||||||
@@ -519,6 +527,13 @@ NodeTreeRuntime :: (slot: s32) -> *AppRuntime {
|
|||||||
return AppHostActiveRuntime(node_runners[slot].nested)
|
return AppHostActiveRuntime(node_runners[slot].nested)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Consume only after the guest VM returns; Profile must never re-enter it.
|
||||||
|
NodeTreeTakeProfile :: () -> bool {
|
||||||
|
requested := node_tree_profile_requested && TextUntilNul(node_tree_profile_account[:]) == NodeTreeAccount()
|
||||||
|
node_tree_profile_requested = false
|
||||||
|
return requested
|
||||||
|
}
|
||||||
|
|
||||||
NodeTreeRunMessage :: (slot: s32, message: Legacy.AppMessage) -> Legacy.AppMessage {
|
NodeTreeRunMessage :: (slot: s32, message: Legacy.AppMessage) -> Legacy.AppMessage {
|
||||||
message.succeeded = false
|
message.succeeded = false
|
||||||
host := node_runners[slot].nested
|
host := node_runners[slot].nested
|
||||||
|
|||||||
+124
-107
@@ -1,6 +1,9 @@
|
|||||||
#import, file "../../apps/leaderboard/leaderboard_achievements.zi";
|
#import, file "../../apps/leaderboard/leaderboard_achievements.zi";
|
||||||
// Leaderboard ranks you with your friends. Saved and fetched results are
|
// Leaderboard ranks you with your friends. Saved and fetched results are
|
||||||
// parsed and ranked once when they change, never on every frame.
|
// parsed and ranked once when they change, never on every frame.
|
||||||
|
#import "entity/leaderboard_model"
|
||||||
|
EntityProfile :: #import "entity/model";
|
||||||
|
#import, file "../apps/node_app_snapshot.zi";
|
||||||
#import "keys"
|
#import "keys"
|
||||||
#import "bundle_host"
|
#import "bundle_host"
|
||||||
#import "byte_text_linux"
|
#import "byte_text_linux"
|
||||||
@@ -566,117 +569,131 @@ LeaderboardUiCall :: (context: *void, module: *u8, function: *u8,
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// Opening the app shows saved results at once and fetches fresh ones.
|
// The old route remains a redirect for saved navigation and older packages.
|
||||||
|
// Profile owns the screen; Inner Breeze supplies its installed boards/data.
|
||||||
|
leaderboard_projection: string;
|
||||||
|
EntityHostOpenLeaderboard :: () #foreign c;
|
||||||
|
|
||||||
|
InbeLeaderboardSnapshot :: (app: *InnerBreeze, request: string) -> string {
|
||||||
|
page: ProfileLeaderboard
|
||||||
|
account: AccountKeys
|
||||||
|
if sync_account_load(*account) != 0 {
|
||||||
|
unused AppCopyText(TextUntilNul(account.public_id[:]), page.owner[:])
|
||||||
|
}
|
||||||
|
if page.owner[0] == cast(u8)0 {
|
||||||
|
unused AppCopyText("local", page.owner[:])
|
||||||
|
}
|
||||||
|
installed := LeaderboardInstalledPractices()
|
||||||
|
LeaderboardListApps(app, installed)
|
||||||
|
for index: cast(s32)0..leaderboard_app_count - 1 {
|
||||||
|
name := TextUntilNul(leaderboard_app_names[index][:])
|
||||||
|
title := TextUntilNul(leaderboard_app_titles[index][:])
|
||||||
|
if name == "practices" {
|
||||||
|
for item: cast(s32)0..installed.practice_count - 1 {
|
||||||
|
if page.board_count >= LEADERBOARD_BOARDS { break }
|
||||||
|
practice := installed.practices[item]
|
||||||
|
board := *page.boards[page.board_count]
|
||||||
|
unused AppCopyText(name, board.app[:])
|
||||||
|
unused AppCopyText(title, board.app_title[:])
|
||||||
|
unused AppCopyText(LeaderboardPracticeId(practice), board.id[:])
|
||||||
|
key := ifx practice == EXERCISE_MEDITATION then "exercise_meditation" else "exercise_wim_hof"
|
||||||
|
unused AppCopyText(LocaleText(key), board.title[:])
|
||||||
|
unused AppCopyText(LocaleText("profile_metric_streak"), board.primary[:])
|
||||||
|
unused AppCopyText(LocaleText(ifx practice == EXERCISE_MEDITATION then "profile_metric_avg_time" else "profile_metric_avg_hold"), board.average[:])
|
||||||
|
page.board_count += 1
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
games: [GAME_SCORES_MAX]s32
|
||||||
|
count := GameScoresFor(name, games[:])
|
||||||
|
for item: cast(s32)0..count - 1 {
|
||||||
|
score := *game_scores[games[item]]
|
||||||
|
game := TextUntilNul(score.game[:])
|
||||||
|
if page.board_count >= LEADERBOARD_BOARDS || !NodeAppInstalledIdentity(name, game) { continue }
|
||||||
|
board := *page.boards[page.board_count]
|
||||||
|
unused AppCopyText(name, board.app[:])
|
||||||
|
unused AppCopyText(title, board.app_title[:])
|
||||||
|
unused AppCopyText(game, board.id[:])
|
||||||
|
unused AppCopyText(TextUntilNul(score.title[:]), board.title[:])
|
||||||
|
unused AppCopyText(LocaleText("leaderboard_levels"), board.primary[:])
|
||||||
|
page.board_count += 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
current := ifx LeaderboardAppName(app) == "practices" then LeaderboardPracticeId(app.leaderboard_practice) else LeaderboardBoardName(app)
|
||||||
|
page.selected = ProfileBoardFind(*page, current)
|
||||||
|
if page.selected < 0 && page.board_count > 0 { page.selected = 0 }
|
||||||
|
owner: [97]u8
|
||||||
|
board_id: [65]u8
|
||||||
|
metric := ReadNumber(request, FieldAt(request, 0, "metric"))
|
||||||
|
if ReadStringText(request, FieldAt(request, 0, "owner"), owner[:]) > 0 &&
|
||||||
|
TextUntilNul(owner[:]) == TextUntilNul(page.owner[:]) &&
|
||||||
|
ReadStringText(request, FieldAt(request, 0, "board"), board_id[:]) > 0 &&
|
||||||
|
metric.valid && (metric.value == 0 || metric.value == 1) {
|
||||||
|
chosen := ProfileBoardFind(*page, TextUntilNul(board_id[:]))
|
||||||
|
if chosen >= 0 {
|
||||||
|
page.selected = chosen
|
||||||
|
app.leaderboard_metric = ifx page.boards[chosen].average[0] != cast(u8)0 then cast(s32)metric.value else 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if page.selected >= 0 {
|
||||||
|
board := *page.boards[page.selected]
|
||||||
|
chosen := TextUntilNul(board.id[:])
|
||||||
|
changed := chosen != current
|
||||||
|
if board.average[0] == cast(u8)0 {
|
||||||
|
app.leaderboard_metric = LEADERBOARD_STREAK
|
||||||
|
}
|
||||||
|
unused AppCopyText(TextUntilNul(board.app[:]), app.leaderboard_app[:])
|
||||||
|
if TextUntilNul(board.app[:]) == "practices" {
|
||||||
|
for item: cast(s32)0..installed.practice_count - 1 {
|
||||||
|
practice := installed.practices[item]
|
||||||
|
if LeaderboardPracticeId(practice) == chosen { app.leaderboard_practice = practice }
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
unused AppCopyText(chosen, app.leaderboard_game[:])
|
||||||
|
}
|
||||||
|
// Refresh only the selected, currently installed board.
|
||||||
|
LeaderboardListApps(app, installed)
|
||||||
|
if changed || request == "refresh" {
|
||||||
|
if changed { app.leaderboard_metric = LEADERBOARD_STREAK }
|
||||||
|
LeaderboardLoadCache(app)
|
||||||
|
app_request_social_refresh(app)
|
||||||
|
}
|
||||||
|
if app.leaderboard_loaded == 0 || leaderboard_built_revision != app.leaderboard_revision ||
|
||||||
|
leaderboard_built_practice != app.leaderboard_practice || leaderboard_built_metric != app.leaderboard_metric ||
|
||||||
|
TextUntilNul(leaderboard_built_app[:]) != LeaderboardAppName(app) ||
|
||||||
|
TextUntilNul(leaderboard_built_board[:]) != LeaderboardBoardName(app) {
|
||||||
|
LeaderboardRebuild(app)
|
||||||
|
}
|
||||||
|
page.metric = app.leaderboard_metric
|
||||||
|
page.loading = app_social_refresh_loading() != 0
|
||||||
|
page.row_count = leaderboard_count
|
||||||
|
for index: cast(s32)0..leaderboard_count - 1 {
|
||||||
|
source := *leaderboard_entries[index]
|
||||||
|
row := *page.rows[index]
|
||||||
|
unused AppCopyText(TextUntilNul(source.name[:]), row.name[:])
|
||||||
|
unused AppCopyText(TextUntilNul(source.streak[:]), row.value[:])
|
||||||
|
unused AppCopyText(TextUntilNul(source.average[:]), row.average[:])
|
||||||
|
row.own = source.own
|
||||||
|
if row.own && TextUntilNul(board.app[:]) == "practices" {
|
||||||
|
AchievementLeaderboardViewed(chosen)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
EntityProfile.EntityFree(leaderboard_projection)
|
||||||
|
leaderboard_projection = ProfileLeaderboardEncode(*page)
|
||||||
|
return leaderboard_projection
|
||||||
|
}
|
||||||
|
|
||||||
#program_export
|
#program_export
|
||||||
leaderboard_screen_enter :: (app: *InnerBreeze) {
|
leaderboard_screen_enter :: (app: *InnerBreeze) {
|
||||||
if app == null {
|
if app == null { return }
|
||||||
return
|
app_open_profile_tab(app, PROFILE_TAB_OVERVIEW)
|
||||||
}
|
EntityHostOpenLeaderboard()
|
||||||
load_friends_cache(app)
|
|
||||||
LeaderboardListApps(app, LeaderboardInstalledPractices())
|
|
||||||
unused LeaderboardKeepInstalled(app, LeaderboardInstalledPractices())
|
|
||||||
LeaderboardLoadCache(app)
|
|
||||||
app_request_social_refresh(app)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#program_export
|
#program_export
|
||||||
leaderboard_screen_draw :: (app: *InnerBreeze) {
|
leaderboard_screen_draw :: (app: *InnerBreeze) {
|
||||||
if app == null {
|
if app == null { return }
|
||||||
return
|
app_open_profile_tab(app, PROFILE_TAB_OVERVIEW)
|
||||||
}
|
EntityHostOpenLeaderboard()
|
||||||
installed := LeaderboardInstalledPractices()
|
|
||||||
LeaderboardListApps(app, installed)
|
|
||||||
if LeaderboardKeepInstalled(app, installed) {
|
|
||||||
LeaderboardLoadCache(app)
|
|
||||||
app_request_social_refresh(app)
|
|
||||||
}
|
|
||||||
if app.leaderboard_practice < 0 || app.leaderboard_practice >= EXERCISE_COUNT {
|
|
||||||
app.leaderboard_practice = EXERCISE_WIM_HOF
|
|
||||||
app.leaderboard_loaded = 0
|
|
||||||
}
|
|
||||||
if app.leaderboard_metric != LEADERBOARD_STREAK &&
|
|
||||||
(app.leaderboard_metric != LEADERBOARD_AVERAGE || !LeaderboardHasAverage(app.leaderboard_practice)) {
|
|
||||||
app.leaderboard_metric = LEADERBOARD_STREAK
|
|
||||||
}
|
|
||||||
if app.leaderboard_loaded == 0 || leaderboard_built_revision != app.leaderboard_revision ||
|
|
||||||
leaderboard_built_practice != app.leaderboard_practice ||
|
|
||||||
leaderboard_built_metric != app.leaderboard_metric ||
|
|
||||||
TextUntilNul(leaderboard_built_app[:]) != LeaderboardAppName(app) ||
|
|
||||||
TextUntilNul(leaderboard_built_board[:]) != LeaderboardBoardName(app) {
|
|
||||||
LeaderboardRebuild(app)
|
|
||||||
}
|
|
||||||
leaderboard_ui.session = app.ui.session
|
|
||||||
leaderboard_ui.width = app.ui.view_width
|
|
||||||
leaderboard_ui.height = app.ui.view_height
|
|
||||||
leaderboard_ui.bottom = app_content_bottom_reserved(app)
|
|
||||||
leaderboard_ui.scale = MetricsScale()
|
|
||||||
leaderboard_ui.font = AppFontSize()
|
|
||||||
leaderboard_ui.app_count = leaderboard_app_count
|
|
||||||
for index: cast(s32)0..leaderboard_app_count - 1 {
|
|
||||||
if TextUntilNul(leaderboard_app_names[index][:]) == LeaderboardAppName(app) {
|
|
||||||
leaderboard_ui.app_index = index
|
|
||||||
}
|
|
||||||
}
|
|
||||||
leaderboard_ui.board_count = leaderboard_board_count
|
|
||||||
leaderboard_ui.board_index = 0
|
|
||||||
for index: cast(s32)0..leaderboard_board_count - 1 {
|
|
||||||
if TextUntilNul(game_scores[leaderboard_boards[index]].game[:]) == LeaderboardBoardName(app) {
|
|
||||||
leaderboard_ui.board_index = index
|
|
||||||
}
|
|
||||||
}
|
|
||||||
state := LeaderboardMessage.{.action = LEADERBOARD_FRAME,
|
|
||||||
.practice = app.leaderboard_practice, .metric = app.leaderboard_metric,
|
|
||||||
.row_count = leaderboard_count, .signed_in = leaderboard_signed_in,
|
|
||||||
.loading = app_social_refresh_loading() != 0,
|
|
||||||
.has_average = LeaderboardAppName(app) == "practices" && LeaderboardHasAverage(app.leaderboard_practice),
|
|
||||||
.app = LeaderboardAppName(app), .board = LeaderboardBoardName(app),
|
|
||||||
.practices_listed = true, .practice_count = installed.practice_count,
|
|
||||||
.practices = installed.practices}
|
|
||||||
WidgetHostBegin(app.ui.session, HostedAssetAllowed)
|
|
||||||
AppsUiBegin(LeaderboardUiCall, cast(*void)app)
|
|
||||||
state = LeaderboardRun(state)
|
|
||||||
AppsUiEnd()
|
|
||||||
WidgetHostEnd()
|
|
||||||
if !state.succeeded {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if state.app != LeaderboardAppName(app) {
|
|
||||||
for index: cast(s32)0..leaderboard_app_count - 1 {
|
|
||||||
if state.app == TextUntilNul(leaderboard_app_names[index][:]) {
|
|
||||||
unused AppCopyText(state.app, app.leaderboard_app[:])
|
|
||||||
app.leaderboard_metric = LEADERBOARD_STREAK
|
|
||||||
leaderboard_ui.scroll = 0
|
|
||||||
LeaderboardLoadCache(app)
|
|
||||||
app_request_social_refresh(app)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if state.board != LeaderboardBoardName(app) {
|
|
||||||
for index: cast(s32)0..leaderboard_board_count - 1 {
|
|
||||||
if state.board == TextUntilNul(game_scores[leaderboard_boards[index]].game[:]) {
|
|
||||||
unused AppCopyText(state.board, app.leaderboard_game[:])
|
|
||||||
leaderboard_ui.scroll = 0
|
|
||||||
LeaderboardLoadCache(app)
|
|
||||||
app_request_social_refresh(app)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if state.practice != app.leaderboard_practice && state.practice >= 0 &&
|
|
||||||
state.practice < EXERCISE_COUNT {
|
|
||||||
app.leaderboard_practice = state.practice
|
|
||||||
app.leaderboard_metric = LEADERBOARD_STREAK
|
|
||||||
leaderboard_ui.scroll = 0
|
|
||||||
LeaderboardLoadCache(app)
|
|
||||||
app_request_social_refresh(app)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if state.metric == LEADERBOARD_STREAK ||
|
|
||||||
(state.metric == LEADERBOARD_AVERAGE && LeaderboardHasAverage(app.leaderboard_practice)) {
|
|
||||||
app.leaderboard_metric = state.metric
|
|
||||||
}
|
|
||||||
if state.refresh {
|
|
||||||
app_request_social_refresh(app)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -447,5 +447,8 @@ node_app_screen_draw :: (app: *InnerBreeze) {
|
|||||||
}
|
}
|
||||||
if clip.opened { unused End(app.ui.session) }
|
if clip.opened { unused End(app.ui.session) }
|
||||||
WidgetHostEnd()
|
WidgetHostEnd()
|
||||||
|
if NodeTreeTakeProfile() {
|
||||||
|
app_open_profile_tab(app, PROFILE_TAB_OVERVIEW)
|
||||||
|
}
|
||||||
NodeScreenMediaPicker(app)
|
NodeScreenMediaPicker(app)
|
||||||
}
|
}
|
||||||
@@ -23,9 +23,9 @@ Answer :: () -> s32 {
|
|||||||
}
|
}
|
||||||
// Every app round-trips by name; unknown and repeated names drop out.
|
// Every app round-trips by name; unknown and repeated names drop out.
|
||||||
read: [LAUNCHER_APP_COUNT]s32
|
read: [LAUNCHER_APP_COUNT]s32
|
||||||
if LauncherOrderRoutes("diary,chess,lumi,,diary,leaderboard,lists", read[:]) != 4 ||
|
if LauncherOrderRoutes("diary,chess,lumi,,diary,leaderboard,lists", read[:]) != 3 ||
|
||||||
read[0] != APP_NAV_ROUTE_DIARY || read[1] != APP_NAV_ROUTE_LUMI ||
|
read[0] != APP_NAV_ROUTE_DIARY || read[1] != APP_NAV_ROUTE_LUMI ||
|
||||||
read[2] != APP_NAV_ROUTE_LEADERBOARD || read[3] != APP_NAV_ROUTE_ELIST {
|
read[2] != APP_NAV_ROUTE_ELIST {
|
||||||
return 22
|
return 22
|
||||||
}
|
}
|
||||||
if LauncherOrderRoutes("", read[:]) != 0 || LauncherOrderText(read[:], 0, order[:]) != 0 ||
|
if LauncherOrderRoutes("", read[:]) != 0 || LauncherOrderText(read[:], 0, order[:]) != 0 ||
|
||||||
@@ -37,11 +37,11 @@ Answer :: () -> s32 {
|
|||||||
PackageSetNodeApp(0, "chess")
|
PackageSetNodeApp(0, "chess")
|
||||||
every := LauncherRoutes()
|
every := LauncherRoutes()
|
||||||
length = LauncherOrderText(every[:], cast(s32)every.count, order[:])
|
length = LauncherOrderText(every[:], cast(s32)every.count, order[:])
|
||||||
if TextView(order[:length]) != "diary,habits,lists,lumi,practices,leaderboard,chess" ||
|
if TextView(order[:length]) != "diary,habits,lists,lumi,practices,chess" ||
|
||||||
LauncherOrderRoutes(TextView(order[:length]), read[:]) != 7 {
|
LauncherOrderRoutes(TextView(order[:length]), read[:]) != 6 {
|
||||||
return 24
|
return 24
|
||||||
}
|
}
|
||||||
for index: cast(s32)0..6 {
|
for index: cast(s32)0..5 {
|
||||||
if read[index] != every[index] { return 25 }
|
if read[index] != every[index] { return 25 }
|
||||||
}
|
}
|
||||||
PackageSetNodeApp(0, "")
|
PackageSetNodeApp(0, "")
|
||||||
@@ -96,9 +96,8 @@ Answer :: () -> s32 {
|
|||||||
count = LauncherPlaceFavorite(favorites[:], count, APP_NAV_ROUTE_PRACTICE, count)
|
count = LauncherPlaceFavorite(favorites[:], count, APP_NAV_ROUTE_PRACTICE, count)
|
||||||
if count != LAUNCHER_APP_COUNT || favorites[count - 1] != APP_NAV_ROUTE_PRACTICE ||
|
if count != LAUNCHER_APP_COUNT || favorites[count - 1] != APP_NAV_ROUTE_PRACTICE ||
|
||||||
favorites[0] != APP_NAV_ROUTE_DIARY { return 14 }
|
favorites[0] != APP_NAV_ROUTE_DIARY { return 14 }
|
||||||
// Leaderboard is listed after the apps that existed before it, and the
|
// Leaderboard is reached through Profile; node app slots follow the five bundled apps.
|
||||||
// slots of the apps the node offers after the bundled apps.
|
if LauncherRoutes()[5] != AppNavNodeRoute(0) ||
|
||||||
if LauncherRoutes()[5] != APP_NAV_ROUTE_LEADERBOARD || LauncherRoutes()[6] != AppNavNodeRoute(0) ||
|
|
||||||
LauncherRoutes()[LAUNCHER_APP_COUNT - 1] != AppNavNodeRoute(7) { return 21 }
|
LauncherRoutes()[LAUNCHER_APP_COUNT - 1] != AppNavNodeRoute(7) { return 21 }
|
||||||
count = LauncherToggleFavorite(favorites[:], count, APP_NAV_ROUTE_HABITS)
|
count = LauncherToggleFavorite(favorites[:], count, APP_NAV_ROUTE_HABITS)
|
||||||
count = LauncherPlaceFavorite(favorites[:], count, APP_NAV_ROUTE_HABITS, 1)
|
count = LauncherPlaceFavorite(favorites[:], count, APP_NAV_ROUTE_HABITS, 1)
|
||||||
|
|||||||
@@ -782,7 +782,8 @@ with contextlib.ExitStack() as stack:
|
|||||||
wait_setting(profile, "package_updates_allowed", 0)
|
wait_setting(profile, "package_updates_allowed", 0)
|
||||||
driver.wait_gone(label="Don't allow", role="button")
|
driver.wait_gone(label="Don't allow", role="button")
|
||||||
assert not driver.find(label="More apps"), "The old section heading remains"
|
assert not driver.find(label="More apps"), "The old section heading remains"
|
||||||
for label in ("Lists", "Diary", "Leaderboard"):
|
assert not any(card["label"] == "Leaderboard" for card in cards()[1]), "Leaderboard still has its own app card"
|
||||||
|
for label in ("Lists", "Diary"):
|
||||||
card = next(node for node in cards()[1] if node["label"] == label)
|
card = next(node for node in cards()[1] if node["label"] == label)
|
||||||
assert corner(card, driver.tree())["label"] == "App options", f"{label} is not preinstalled"
|
assert corner(card, driver.tree())["label"] == "App options", f"{label} is not preinstalled"
|
||||||
# Practice is the third pinned card in the same grid as the rest.
|
# Practice is the third pinned card in the same grid as the rest.
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
"""Leaderboard opens as its own unpinned app, offers every installed practice
|
"""Profile owns the leaderboard, offers installed ranked boards and preserves friend results."""
|
||||||
and ranks saved friend results."""
|
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
@@ -94,6 +93,20 @@ def choose(label):
|
|||||||
driver.wait_idle(frames=2, timeout=2)
|
driver.wait_idle(frames=2, timeout=2)
|
||||||
|
|
||||||
|
|
||||||
|
def open_leaderboard():
|
||||||
|
driver.press(label="Apps", role="button")
|
||||||
|
driver.wait(label="Pinned")
|
||||||
|
driver.press(focus_id=6792, role="button")
|
||||||
|
driver.wait(label="Change picture", role="button")
|
||||||
|
for _ in range(12):
|
||||||
|
if driver.find(label="Leaderboard", role="button", visible=True):
|
||||||
|
break
|
||||||
|
driver.pointer(WIDTH // 2, HEIGHT // 2, wheel=-3)
|
||||||
|
driver.wait_idle(frames=2, timeout=2)
|
||||||
|
driver.press(label="Leaderboard", role="button")
|
||||||
|
driver.wait(label="Leaderboard", role="text")
|
||||||
|
|
||||||
|
|
||||||
def stop(process):
|
def stop(process):
|
||||||
if process.poll() is None:
|
if process.poll() is None:
|
||||||
process.terminate()
|
process.terminate()
|
||||||
@@ -151,11 +164,9 @@ with tempfile.TemporaryDirectory(prefix="inbe-leaderboard-") as directory:
|
|||||||
"apps_setup_done": 1, "app_used_leaderboard": 1, "main_tab": 5, "tutorial_seen": 1,
|
"apps_setup_done": 1, "app_used_leaderboard": 1, "main_tab": 5, "tutorial_seen": 1,
|
||||||
"habits_guide_seen": 1, "lumi_guides_seen": 127, "launcher_guide_seen": 1, "package_updates_allowed": 0,
|
"habits_guide_seen": 1, "lumi_guides_seen": 127, "launcher_guide_seen": 1, "package_updates_allowed": 0,
|
||||||
"apps_last_update_check": 1900000000,
|
"apps_last_update_check": 1900000000,
|
||||||
# Pinned here, so the page has no "back to Apps" bar and
|
# Profile remains a permanent control; Leaderboard has no app pin.
|
||||||
# the controls keep fixed positions.
|
"launcher_favorite_count": 3, "launcher_favorite_0": 12,
|
||||||
"launcher_favorite_count": 4, "launcher_favorite_0": 12,
|
|
||||||
"launcher_favorite_1": 1, "launcher_favorite_2": 2,
|
"launcher_favorite_1": 1, "launcher_favorite_2": 2,
|
||||||
"launcher_favorite_3": LEADERBOARD_ROUTE,
|
|
||||||
# Astral Projection first in the saved Practice order.
|
# Astral Projection first in the saved Practice order.
|
||||||
"practice_order": 1503124}
|
"practice_order": 1503124}
|
||||||
for key, value in settings.items():
|
for key, value in settings.items():
|
||||||
@@ -196,6 +207,7 @@ with tempfile.TemporaryDirectory(prefix="inbe-leaderboard-") as directory:
|
|||||||
shutil.copyfile(root / "build/practice-content/taichi.zx", packages / "practice-taichi.zx")
|
shutil.copyfile(root / "build/practice-content/taichi.zx", packages / "practice-taichi.zx")
|
||||||
app, window = launch(profile, "board")
|
app, window = launch(profile, "board")
|
||||||
try:
|
try:
|
||||||
|
open_leaderboard()
|
||||||
# Only Wim Hof and Meditation are ranked, in Practice's order, side by side on phones.
|
# Only Wim Hof and Meditation are ranked, in Practice's order, side by side on phones.
|
||||||
expected = [["Wim Hof Breathing", "Meditation"]]
|
expected = [["Wim Hof Breathing", "Meditation"]]
|
||||||
grid = practice_grid(expected)
|
grid = practice_grid(expected)
|
||||||
@@ -227,6 +239,7 @@ with tempfile.TemporaryDirectory(prefix="inbe-leaderboard-") as directory:
|
|||||||
shutil.copyfile(root / "build/practice-content/sunsalutation.zx", packages / "practice-sunsalutation.zx")
|
shutil.copyfile(root / "build/practice-content/sunsalutation.zx", packages / "practice-sunsalutation.zx")
|
||||||
app, window = launch(profile, "with-sun-salutation")
|
app, window = launch(profile, "with-sun-salutation")
|
||||||
try:
|
try:
|
||||||
|
open_leaderboard()
|
||||||
expected = [["Wim Hof Breathing", "Meditation"]]
|
expected = [["Wim Hof Breathing", "Meditation"]]
|
||||||
grid = practice_grid(expected)
|
grid = practice_grid(expected)
|
||||||
assert grid == expected, f"after download: {grid}"
|
assert grid == expected, f"after download: {grid}"
|
||||||
@@ -252,5 +265,5 @@ with tempfile.TemporaryDirectory(prefix="inbe-about-") as directory:
|
|||||||
assert about.returncode == 0 and shot.exists(), stdout[-4000:] + stderr[-2000:]
|
assert about.returncode == 0 and shot.exists(), stdout[-4000:] + stderr[-2000:]
|
||||||
assert "out of bounds" not in stdout + stderr, stdout[-4000:]
|
assert "out of bounds" not in stdout + stderr, stdout[-4000:]
|
||||||
driver_directory.cleanup()
|
driver_directory.cleanup()
|
||||||
print("Leaderboard: preinstalled and unpinned, only Wim Hof and Meditation ranked, saved ranks, average hold, "
|
print("Leaderboard: shared Profile route, only Wim Hof and Meditation ranked, saved ranks, average hold, "
|
||||||
"meditation time, only ranked apps offered, a downloaded practice staying unranked and About passed")
|
"meditation time, only ranked apps offered, a downloaded practice staying unranked and About passed")
|
||||||
Reference in new issue
Block a user