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 ────────────────────────