From bb01c58f40788bb80f069f73613f13c12af7566a Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Tue, 31 Mar 2026 07:08:46 +0000 Subject: [PATCH] Mark session as read when opened in Sessions window (#306603) * Initial plan * fix: mark session as read when opening it in Sessions window When a session was marked as unread via the context menu, clicking on it again did not change it back to read. This adds setRead(session, true) in sessionsManagementService.openSession() and openChat(), following the same pattern used in agentSessionsOpener.ts. Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/04e61e19-5790-4bc5-8075-95457ae5adbd Co-authored-by: bpasero <900690+bpasero@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: bpasero <900690+bpasero@users.noreply.github.com> --- .../contrib/sessions/browser/sessionsManagementService.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/vs/sessions/contrib/sessions/browser/sessionsManagementService.ts b/src/vs/sessions/contrib/sessions/browser/sessionsManagementService.ts index 2cb471f645e..ac63065866d 100644 --- a/src/vs/sessions/contrib/sessions/browser/sessionsManagementService.ts +++ b/src/vs/sessions/contrib/sessions/browser/sessionsManagementService.ts @@ -467,6 +467,9 @@ export class SessionsManagementService extends Disposable implements ISessionsMa this.logService.info(`[SessionsManagement] openChat: ${chatResource.toString()} provider=${chat?.providerId}`); this.isNewChatSessionContext.set(false); this.setActiveSession(sessionData); + if (sessionData) { + this.setRead(sessionData, true); // mark as read when opened + } await this.chatWidgetService.openSession(chatResource, ChatViewPaneTarget); } @@ -480,6 +483,7 @@ export class SessionsManagementService extends Disposable implements ISessionsMa this.logService.info(`[SessionsManagement] openSession: ${sessionResource.toString()} provider=${sessionData.providerId}`); this.isNewChatSessionContext.set(false); this.setActiveSession(sessionData); + this.setRead(sessionData, true); // mark as read when opened const activeChatResource = sessionData.activeChat.get().resource; await this.chatWidgetService.openSession(activeChatResource, ChatViewPaneTarget, { preserveFocus: options?.preserveFocus });