Active Sessions
@@ -1145,12 +1245,29 @@
}
function renderSessions() {
+ // Update sessions count button text
+ updateSessionsCountButton();
+
if (state.sessions.size === 0) {
$sessions.innerHTML = '
No active sessions
';
return;
}
- $sessions.innerHTML = Array.from(state.sessions.values()).map(s => `
+ // Filter sessions if focusSessionId is set
+ let sessionsToRender = Array.from(state.sessions.values());
+ if (state.settings.focusSessionId !== null) {
+ const focusSession = state.sessions.get(state.settings.focusSessionId);
+ if (focusSession) {
+ sessionsToRender = [focusSession];
+ } else {
+ // Filtered session no longer exists, clear filter
+ state.settings.focusSessionId = null;
+ saveSettings();
+ updateSessionsCountButton();
+ }
+ }
+
+ $sessions.innerHTML = sessionsToRender.map(s => `