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);