From 9d71bf5f6b51384b02ab27a0cdccecbd10dc020b Mon Sep 17 00:00:00 2001 From: Lyon <88232613+pikasTech@users.noreply.github.com> Date: Wed, 3 Jun 2026 14:45:26 +0800 Subject: [PATCH] fix(web): HWLAB #748 initCommandBar orphan el.commandNewSession listener (#752) PR #746 (#744) removed the duplicate `command-new-session` button from index.html and the `el.commandNewSession` field from the `el` literal, but left `el.commandNewSession.addEventListener("click", ...)` inside `initCommandBar()`. The resulting undefined reference crashed every Cloud Workbench init with app.js:5414 Uncaught TypeError: Cannot read properties of undefined (reading 'addEventListener') at initCommandBar (app.js:5414:24) at app.js:3538:1 The new session entry point is `#session-create` in the session sidebar (added in #740/#743), so this listener is no longer needed. Removal is the minimal fix; all other command-bar bindings (`commandInput`, `commandForm`, `commandClear`) are untouched. Verified locally: - web:check (54 tests pass, all static contracts pass) - web:build (12 dist files fresh) - dist/app.js: 0 references to commandNewSession Refs: pikasTech/HWLAB#748 Co-authored-by: Codex --- web/hwlab-cloud-web/app-device-pod.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/web/hwlab-cloud-web/app-device-pod.ts b/web/hwlab-cloud-web/app-device-pod.ts index 84e5a946..780a0451 100644 --- a/web/hwlab-cloud-web/app-device-pod.ts +++ b/web/hwlab-cloud-web/app-device-pod.ts @@ -55,14 +55,6 @@ function initCommandBar() { await submitAgentMessage(value); }); - el.commandNewSession.addEventListener("click", () => { - createManualAgentSession().catch((error) => { - state.sessionStatus = "failed"; - renderAgentChatStatus("failed", { error }); - renderCodeAgentSummary(); - }); - }); - el.commandClear.addEventListener("click", () => { for (const close of state.traceStreams.values()) close(); state.traceStreams.clear();