diff --git a/muxplex/frontend/app.js b/muxplex/frontend/app.js index 82da23b..61d0efc 100644 --- a/muxplex/frontend/app.js +++ b/muxplex/frontend/app.js @@ -721,6 +721,7 @@ function renderGroupedGrid(sessions, mobile) { * @param {Array} allSessions - Full (unfiltered) session list used to derive device names. */ function renderFilterBar(container, allSessions) { + allSessions = allSessions || []; // Collect unique device names preserving insertion order var devices = []; var seen = {}; diff --git a/muxplex/frontend/tests/test_app.mjs b/muxplex/frontend/tests/test_app.mjs index f30ad30..ba770ba 100644 --- a/muxplex/frontend/tests/test_app.mjs +++ b/muxplex/frontend/tests/test_app.mjs @@ -2570,7 +2570,7 @@ test('renderFilterBar produces pill buttons for each device plus All', () => { assert.ok(html.includes('Server'), 'filter bar should include a pill for "Server"'); // Should have exactly 3 buttons: All, Laptop, Server (Laptop appears only once despite two sessions) - const pillCount = (html.match(/filter-pill/g) || []).length; + const pillCount = (html.match(/