From 4979df4a9f71e2bf17a89f0ccf61bc19f98488ee Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 24 Jan 2026 03:33:56 +0100 Subject: [PATCH] fix: notification click now navigates to affected session switchToSession didn't exist - was calling a nonexistent method. Changed to selectSession which actually switches the active tab and loads the terminal buffer. Also enhanced browser push notifications to navigate to the session when clicked (previously only focused window). Co-Authored-By: Claude Opus 4.5 --- src/web/public/app.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/web/public/app.js b/src/web/public/app.js index fab7d263..1edc0623 100644 --- a/src/web/public/app.js +++ b/src/web/public/app.js @@ -106,7 +106,7 @@ class NotificationManager { // Layer 3: Browser notification (when tab hidden, critical/warning only) if (!this.isTabVisible && (urgency === 'critical' || urgency === 'warning')) { - this.sendBrowserNotif(title, message, category); + this.sendBrowserNotif(title, message, category, sessionId); } // Layer 4: Audio alert (critical only) @@ -181,7 +181,7 @@ class NotificationManager { } // Layer 3: Web Notification API - sendBrowserNotif(title, body, tag) { + sendBrowserNotif(title, body, tag, sessionId) { if (!this.preferences.browserNotifications) return; if (typeof Notification === 'undefined') return; if (Notification.permission !== 'granted') return; @@ -200,6 +200,9 @@ class NotificationManager { notif.onclick = () => { window.focus(); + if (sessionId && this.app.sessions.has(sessionId)) { + this.app.selectSession(sessionId); + } notif.close(); }; @@ -268,7 +271,7 @@ class NotificationManager { // Switch to session if available if (notif.sessionId && this.app.sessions.has(notif.sessionId)) { - this.app.switchToSession(notif.sessionId); + this.app.selectSession(notif.sessionId); this.toggleDrawer(); }