From 463a8e2f8a6e01852f186004b62a6e2c41e67c97 Mon Sep 17 00:00:00 2001 From: saopig1 <4x7sw862st@gmail.com> Date: Sat, 30 May 2026 15:17:01 +0800 Subject: [PATCH] feat(scope): lock Navbar selector to scoped bot + apply scope on load Co-Authored-By: Claude Opus 4.8 (1M context) --- web/src/App.vue | 9 +++- web/src/components/Navbar.vue | 85 +++++++++++++++++++++++++++++++++-- 2 files changed, 89 insertions(+), 5 deletions(-) diff --git a/web/src/App.vue b/web/src/App.vue index d7dbbf0..adc1834 100644 --- a/web/src/App.vue +++ b/web/src/App.vue @@ -140,12 +140,17 @@ function cycleMobileMode() { playerStore.setMode(nextMode); } -onMounted(() => { +onMounted(async () => { playerStore.loadTheme(); connect(); - playerStore.fetchBots(); syncTimer = setInterval(() => playerStore.syncElapsed(), 3000); mobileRaf = requestAnimationFrame(updateMobileProgress); + // Reconcile the dedicated-link scope only after the bot list is known: the + // router guard sets scopedBotId tentatively from ?bot, but applyScopeFromQuery + // validates it against the loaded bots (locks if it exists, clears if stale). + await playerStore.fetchBots(); + const qBot = typeof route.query.bot === 'string' ? route.query.bot : null; + playerStore.applyScopeFromQuery(qBot); }); onUnmounted(() => { diff --git a/web/src/components/Navbar.vue b/web/src/components/Navbar.vue index 1024b3f..bd05bd0 100644 --- a/web/src/components/Navbar.vue +++ b/web/src/components/Navbar.vue @@ -10,8 +10,20 @@