mirror of
https://github.com/ZHANGTIANYAO1/teamspeak-music-bot.git
synced 2026-10-02 04:52:50 +08:00
fix(ws): re-attach stateChange listeners when bot instance is replaced
startBot creates a fresh BotInstance but the WS layer keyed its listener map by bot.id, so ensureAllBotsAttached skipped the new object and stateChange events were never broadcast — the player bar only appeared after a manual refresh. BotManager now extends EventEmitter and emits "botInstance" whenever a new bot object is created; websocket.ts stores the bot reference, detaches on replacement, and subscribes to the event for immediate wiring. Also enlarges the bot selector (padding 10×20, font 16, min-height 44, bigger dot/chevron/state icons, wider name) and adds Playwright repro scripts for the player bar bug and navbar sizing check. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
d5d6abeb1e
commit
6e828b9c2d
6 files changed
+161
-22
No files matched your search
@@ -0,0 +1,12 @@
|
||||
from playwright.sync_api import sync_playwright
|
||||
|
||||
with sync_playwright() as p:
|
||||
browser = p.chromium.launch(headless=True)
|
||||
page = browser.new_page(viewport={"width": 1440, "height": 900})
|
||||
page.goto("http://localhost:3000")
|
||||
page.wait_for_load_state("networkidle")
|
||||
page.wait_for_timeout(800)
|
||||
page.locator(".navbar").screenshot(path="scripts/navbar_bigger.png")
|
||||
rect = page.locator(".bot-selector-btn").bounding_box()
|
||||
print("bot-selector-btn bbox:", rect)
|
||||
browser.close()
|
||||
Reference in new issue
Block a user