diff --git a/static/adwright.js b/static/adwright.js index 1eed445..c0fb1c3 100644 --- a/static/adwright.js +++ b/static/adwright.js @@ -154,10 +154,17 @@ _activateTab(id); }); }); - // Cross-panel link to BTE Command Center. + // Cross-panel link to BTE Command Center. Route through canonical + // switchPanel so main.svrnty-showing-bte class gets flipped (CSS gates + // overlay visibility on that class). SvrntyBTE.open is fallback for + // the early-boot edge case where the nav wrapper isn't installed yet. const bteBtn = panel.querySelector("#svrntyAwOpenBte"); if (bteBtn) bteBtn.addEventListener("click", () => { - if (window.SvrntyBTE && window.SvrntyBTE.open) window.SvrntyBTE.open(); + if (typeof window.switchPanel === "function") { + window.switchPanel("bte", { fromRailClick: true }); + } else if (window.SvrntyBTE && window.SvrntyBTE.open) { + window.SvrntyBTE.open(); + } }); // One-click profile switch to cmo-planb. const switchBtn = panel.querySelector("#svrntyAwSwitchCmo");