From bac23f26dc83825b4bed3a906f97df7c5d6d1121 Mon Sep 17 00:00:00 2001 From: Brian Krabach Date: Mon, 30 Mar 2026 02:49:41 -0700 Subject: [PATCH] fix: apply getVisibleSessions filter in renderSheetList for mobile bottom sheet Hidden sessions were still appearing in the mobile bottom-sheet session switcher because renderSheetList() read _currentSessions directly, bypassing the getVisibleSessions() helper used by renderGrid() and renderSidebar(). - app.js: sortByPriority now receives getVisibleSessions(_currentSessions) instead of _currentSessions directly in renderSheetList() - test_frontend_js.py: add test_render_sheet_list_filters_hidden_sessions to assert getVisibleSessions is called in renderSheetList body Completes consistent hidden-sessions filtering across all three render paths (grid, sidebar, mobile bottom sheet). Co-authored-by: Amplifier --- muxplex/frontend/app.js | 2 +- muxplex/tests/test_frontend_js.py | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/muxplex/frontend/app.js b/muxplex/frontend/app.js index 0bf2082..d7c2232 100644 --- a/muxplex/frontend/app.js +++ b/muxplex/frontend/app.js @@ -1261,7 +1261,7 @@ function closeBottomSheet() { function renderSheetList() { var list = $('sheet-list'); if (!list) return; - var sorted = sortByPriority(_currentSessions); + var sorted = sortByPriority(getVisibleSessions(_currentSessions)); list.innerHTML = sorted.map(function(s) { var hasBell = s.bell && s.bell.unseen_count > 0 && (s.bell.seen_at === null || s.bell.last_fired_at > s.bell.seen_at); diff --git a/muxplex/tests/test_frontend_js.py b/muxplex/tests/test_frontend_js.py index deace2d..95981ca 100644 --- a/muxplex/tests/test_frontend_js.py +++ b/muxplex/tests/test_frontend_js.py @@ -2263,6 +2263,24 @@ def test_render_sidebar_uses_visible_array() -> None: ) +# ── app.js: renderSheetList filters hidden sessions ─────────────────────────── + + +def test_render_sheet_list_filters_hidden_sessions() -> None: + """renderSheetList() must filter out hidden sessions via getVisibleSessions().""" + match = re.search( + r"function renderSheetList\s*\(\)\s*\{(.*?)(?=\n(?:function|//|window\.))", + _JS, + re.DOTALL, + ) + assert match, "renderSheetList function not found in app.js" + body = match.group(1) + assert "getVisibleSessions" in body, ( + "renderSheetList must call getVisibleSessions() to filter hidden sessions; " + "currently it reads _currentSessions directly and bypasses the filter" + ) + + # ── app.js: DOMContentLoaded calls loadServerSettings ────────────────────────