From 0aaed358ba7e4cebdc03cb898a71f7ece2fe3049 Mon Sep 17 00:00:00 2001 From: Waozi Date: Fri, 6 Nov 2026 18:10:51 -0300 Subject: [PATCH] Keep the side navigation when switching Practice tabs Practice Manual and Settings were treated as fullscreen pages, so the desktop rail disappeared and the whole page shifted 88px on each tab switch. They now keep the rail and the Practice highlight; the bottom dock still hides on those tabs. --- CHANGELOG.md | 1 + src/app/app_nav_state.zi | 8 +--- tests/app_nav_state_link_test.c | 79 +++++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f99eaad8b..2ac6ef9d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Open the full web app directly from the Breeze website. - The Breeze website now follows Waozi Studio’s design. - Typing now counts as activity in the break meter. +- Switching Practice tabs with the side navigation no longer shifts the screen. ## [2.1.62] - 2026-11-03 diff --git a/src/app/app_nav_state.zi b/src/app/app_nav_state.zi index 50d333d23..c3cf57662 100644 --- a/src/app/app_nav_state.zi +++ b/src/app/app_nav_state.zi @@ -162,9 +162,8 @@ app_nav_desktop_rail_enabled :: (app: *InnerBreeze) -> s32 { if app.file_dialog_active != 0 { return 0 } - if app_is_practice_fullscreen_subview(app) != 0 { - return 0 - } + // Practice's Manual and Settings tabs keep the rail, so switching tabs + // never slides the page sideways. if app.modal.active != 0 && (app.modal.type == cast(ModalType)ModalEditProgressiveStartSpeed || app.modal.type == cast(ModalType)ModalPracticeConfig || @@ -505,9 +504,6 @@ app_current_nav_route :: (app: *InnerBreeze) -> s32 { return APP_NAV_ROUTE_SETTINGS } if app.breathing.screen == ScreenStart { - if app_is_practice_fullscreen_subview(app) != 0 { - return APP_NAV_ROUTE_NONE - } if app.main_tab == APP_MAIN_TAB_NONE { return APP_NAV_ROUTE_NONE } diff --git a/tests/app_nav_state_link_test.c b/tests/app_nav_state_link_test.c index 993f7ab06..1f5c9fade 100644 --- a/tests/app_nav_state_link_test.c +++ b/tests/app_nav_state_link_test.c @@ -36,6 +36,84 @@ String LocaleText(String key) 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; @@ -54,6 +132,7 @@ int main(void) 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);