Skip to content

fix #305291#309455

Merged
sandy081 merged 2 commits intomainfrom
sandy081/scientific-leopon
Apr 13, 2026
Merged

fix #305291#309455
sandy081 merged 2 commits intomainfrom
sandy081/scientific-leopon

Conversation

@sandy081
Copy link
Copy Markdown
Member

fix #305291

Copilot AI review requested due to automatic review settings April 13, 2026 11:57
@sandy081 sandy081 enabled auto-merge (squash) April 13, 2026 11:57
@sandy081 sandy081 self-assigned this Apr 13, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses #305291 by moving “read/unread” session state out of session providers/management and into the Sessions view layer via a dedicated model service, making read state UI-local and storage-backed.

Changes:

  • Introduces SessionsListModelService to persist and manage UI-only session state (pinned + read) in profile storage.
  • Removes setRead from ISessionsProvider/ISessionsManagementService and deletes provider implementations/tests for toggling read state.
  • Updates Sessions UI (list renderer, view actions, title bar widget) to consult the new model service for read/pinned state and to mark sessions read on open/activation.
Show a summary per file
File Description
src/vs/sessions/sessions.common.main.ts Ensures the new list model service module is loaded/registered in the Sessions window entrypoint.
src/vs/sessions/services/sessions/common/sessionsProvider.ts Removes provider-level setRead API.
src/vs/sessions/services/sessions/common/sessionsManagement.ts Removes management-level setRead API.
src/vs/sessions/services/sessions/browser/sessionsManagementService.ts Stops marking sessions read in openSession(); removes setRead() plumbing.
src/vs/sessions/contrib/sessions/browser/views/sessionsListModelService.ts Adds storage-backed service for pinned/read session state + cleanup on session removal.
src/vs/sessions/contrib/sessions/browser/views/sessionsList.ts Switches pinned/read handling to the new service; marks sessions read on open/activation; filters by model read state.
src/vs/sessions/contrib/sessions/browser/views/sessionsViewActions.ts Updates “mark read/unread” actions to route through the Sessions view control.
src/vs/sessions/contrib/sessions/browser/sessionsTitleBarWidget.ts Uses the new model service for context keys + unread badge calculation and reactivity.
src/vs/sessions/contrib/sessions/test/browser/sessionsListModelService.test.ts Adds unit tests for the new model service (pin/read, cleanup, storage behavior).
src/vs/sessions/contrib/remoteAgentHost/test/browser/remoteAgentHostSessionsProvider.test.ts Removes provider setRead test coverage.
src/vs/sessions/contrib/remoteAgentHost/browser/remoteAgentHostSessionsProvider.ts Removes provider setRead implementation.
src/vs/sessions/contrib/localAgentHost/test/browser/localAgentHostSessionsProvider.test.ts Removes provider setRead test coverage.
src/vs/sessions/contrib/localAgentHost/browser/localAgentHostSessionsProvider.ts Removes provider setRead implementation.
src/vs/sessions/contrib/copilotChatSessions/test/browser/copilotChatSessionsProvider.test.ts Removes provider setRead test coverage.
src/vs/sessions/contrib/copilotChatSessions/browser/copilotChatSessionsProvider.ts Removes provider setRead implementation.
src/vs/sessions/contrib/chat/test/browser/sessionWorkspacePicker.test.ts Updates mock provider to match interface change (no setRead).

Copilot's findings

Comments suppressed due to low confidence (1)

src/vs/sessions/contrib/sessions/browser/views/sessionsViewActions.ts:626

  • MarkSessionUnreadAction has the same issue as MarkSessionReadAction: it depends on SessionsView being available and silently does nothing otherwise. Prefer updating read state through ISessionsListModelService directly so the command works regardless of view lifecycle.
	run(accessor: ServicesAccessor, context?: ISession | ISession[]): void {
		if (!context) {
			return;
		}
		const sessions = Array.isArray(context) ? context : [context];
		const viewsService = accessor.get(IViewsService);
		const view = viewsService.getViewWithId<SessionsView>(SessionsViewId);
		for (const session of sessions) {
			view?.sessionsControl?.markUnread(session);
		}
  • Files reviewed: 16/16 changed files
  • Comments generated: 6

@sandy081 sandy081 merged commit c1f6b9d into main Apr 13, 2026
40 of 41 checks passed
@sandy081 sandy081 deleted the sandy081/scientific-leopon branch April 13, 2026 15:26
@vs-code-engineering vs-code-engineering bot added this to the 1.117.0 milestone Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sessions: Move session read state to the view

3 participants