fix(adwright): route ↗BTE crosslink through canonical switchPanel
Some checks failed
plugin-tests / test (push) Failing after 6s

The Adwright ↗BTE button called SvrntyBTE.open() directly, which sets
overlay.hidden=false but never flips main.svrnty-showing-bte. The CSS
gates BTE overlay visibility on that class, so the click did nothing
visible — overlay was mounted but display:none. Route the click through
window.switchPanel("bte") instead so the canonical nav wrapper handles
class flipping + event dispatch identically to the sidebar BTE button.

Validated via Playwright with 6 gates: V1 sidebar BTE (1 event, class
set, visible), V2 ↗BTE crosslink (1 event, class flip, visible),
V3 Adwright nav (class flip, BTE hidden), V4 main classes correct,
V5 console clean, V6 /api/bte/proxy 200 OK. All pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Svrnty 2026-05-24 17:05:41 -04:00
parent ab24ff9cdb
commit 6c88bf8899

View File

@ -154,10 +154,17 @@
_activateTab(id); _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"); const bteBtn = panel.querySelector("#svrntyAwOpenBte");
if (bteBtn) bteBtn.addEventListener("click", () => { 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. // One-click profile switch to cmo-planb.
const switchBtn = panel.querySelector("#svrntyAwSwitchCmo"); const switchBtn = panel.querySelector("#svrntyAwSwitchCmo");