mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-02 13:39:41 +02:00
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user