From efe2d8966a76d97ea0978f5a063cda9d40a011e6 Mon Sep 17 00:00:00 2001 From: Codeman maintainer Date: Mon, 13 Jul 2026 00:38:56 +0200 Subject: [PATCH] fix(review): rebuild Session Manager additions on the merged #146 implementation (PR #153) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Hide the new btn-session-manager header button on phones: add it to the @media (max-width: 430px) display:none block in mobile.css (next to .btn-away-digest) and to KNOWN_PHONE_HIDDEN in the mobile-header policy test, closing the recurring phone-header-leak regression that was PR #153's red CI job. - Put the session-manager header button on its own line in index.html (was crammed onto the away-digest line). - app.js: drop session:updated from the unified-list SSE refresh trigger — it is batch-broadcast ~every 500ms per active session and would turn an open modal / visible welcome list into a sustained ~1 Hz full projects rescan loop; created/deleted (structural changes) are sufficient. - terminal-ui.js _fetchUnifiedSessions: check the ApiResponse envelope and throw on failure so a 5xx surfaces via the caller's catch instead of rendering an empty history. - terminal-ui.js _openSessionRowMenu: on re-entry, invoke the previous menu's close fn (stored as _openRowMenuClose) so its document/window listeners are detached rather than leaked; use claudeSessionId || sessionId in the 'Resume session' menu item to match the main-row and Session Manager resume routing. Co-Authored-By: Claude Fable 5 --- src/web/public/app.js | 7 ++++-- src/web/public/index.html | 3 ++- src/web/public/mobile.css | 10 ++++---- src/web/public/terminal-ui.js | 29 ++++++++++++++++------- test/mobile-header-buttons-policy.test.ts | 2 +- 5 files changed, 35 insertions(+), 16 deletions(-) diff --git a/src/web/public/app.js b/src/web/public/app.js index 2f5d4b30..ea3ccd66 100644 --- a/src/web/public/app.js +++ b/src/web/public/app.js @@ -1426,8 +1426,11 @@ class CodemanApp { // visible welcome list) on session structural changes. Extra listeners on the // same EventSource — EventSource supports multiple listeners per event — so the // existing handlers above are untouched. Registered through addListener so they - // are torn down with the rest on reconnect. - for (const event of [SSE_EVENTS.SESSION_CREATED, SSE_EVENTS.SESSION_UPDATED, SSE_EVENTS.SESSION_DELETED]) { + // are torn down with the rest on reconnect. Only structural events (created / + // deleted) trigger a refetch: session:updated is batch-broadcast every ~500ms + // per active session, which would otherwise turn an open modal / visible welcome + // list into a sustained ~1 Hz full ~/.claude/projects rescan loop. + for (const event of [SSE_EVENTS.SESSION_CREATED, SSE_EVENTS.SESSION_DELETED]) { addListener(event, () => this._onSessionListMaybeChanged()); } } diff --git a/src/web/public/index.html b/src/web/public/index.html index 23c6c57f..bf1d34ab 100644 --- a/src/web/public/index.html +++ b/src/web/public/index.html @@ -118,7 +118,8 @@ - + +