fix: keep tray session switches in sync

Open tray sessions from the correct directory
Allow remote instances to update the tray
Update the active project when switching sessions
This commit is contained in:
Bohdan Triapitsyn
2026-06-10 02:24:47 +03:00
parent b494dba8ed
commit e53c3da223
3 changed files with 15 additions and 3 deletions
+1
View File
@@ -4004,6 +4004,7 @@ const COMMANDS_SAFE_FOR_REMOTE = new Set([
'desktop_get_app_version',
'desktop_get_lan_address',
'desktop_capture_page_rect',
'desktop_tray_update',
]);
ipcMain.handle('openchamber:invoke', async (event, command, args) => {
+3 -3
View File
@@ -180,13 +180,13 @@ export const createTrayController = ({ idleIconPath, unseenIconPath, breathIconP
{ type: 'separator' },
{ label: 'Deny', click: () => onAction({ type: 'respond-permission', sessionId: approval.sessionId, id: approval.id, response: 'reject' }) },
{ type: 'separator' },
{ label: 'Open in app', click: () => onAction({ type: 'focus-session', sessionId: approval.sessionId }) },
{ label: 'Open in app', click: () => onAction({ type: 'focus-session', sessionId: approval.sessionId, directory: approval.directory || '' }) },
],
};
}
return {
label: approvalLabel(approval),
click: () => onAction({ type: 'focus-session', sessionId: approval.sessionId }),
click: () => onAction({ type: 'focus-session', sessionId: approval.sessionId, directory: approval.directory || '' }),
};
};
for (const approval of approvals.slice(0, MAX_APPROVALS)) {
@@ -209,7 +209,7 @@ export const createTrayController = ({ idleIconPath, unseenIconPath, breathIconP
icon: statusIcons[statusIconKey(session)] || statusIcons.blank,
// Secondary smaller line (macOS): project · branch.
...(session.subtitle ? { sublabel: truncate(session.subtitle, 48) } : {}),
click: () => onAction({ type: 'focus-session', sessionId: session.id }),
click: () => onAction({ type: 'focus-session', sessionId: session.id, directory: session.directory || '' }),
});
if (sessions.length > 0) {