Skip to content

sessions: show restore button instead of checkmark for done sessions#309058

Merged
osortega merged 2 commits intomainfrom
agents/recent-sole
Apr 10, 2026
Merged

sessions: show restore button instead of checkmark for done sessions#309058
osortega merged 2 commits intomainfrom
agents/recent-sole

Conversation

@osortega
Copy link
Copy Markdown
Contributor

Summary

When a session is already marked as done, the checkmark button in the command center was still shown but did nothing on click. This PR replaces it with a Restore button so users can un-archive the session.

Changes

  • IsActiveSessionArchivedContext — new context key that reactively tracks whether the active session is archived
  • MarkSessionAsDoneAction — hidden from the command center when the active session is already archived
  • UnarchiveSessionAction — added to the command center (with active-session fallback when invoked without context) so the restore button appears for done sessions
  • sessionsManagementService — reactively updates IsActiveSessionArchivedContext via an autorun on the active session's isArchived observable

Before / After

Before After
Checkmark shown for done sessions (no-op on click) Restore (discard) icon shown for done sessions

Fixes #307712

When a session is already marked as done, the checkmark button in the
command center was still shown but did nothing on click. Now:

- Hide the 'Mark as Done' checkmark when the active session is archived
- Show the existing 'Restore' button (discard icon) in its place
- Track active session archived state via IsActiveSessionArchivedContext

Fixes #307712

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 10, 2026 17:15
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 improves the Sessions window command center behavior by replacing the no-op “Mark as Done” checkmark on already-done (archived) sessions with a “Restore” action, driven by a new active-session archived context key.

Changes:

  • Introduces IsActiveSessionArchivedContext to reflect whether the currently active session is archived.
  • Updates command center menu visibility: hides “Mark as Done” when the active session is archived, and shows “Restore” instead.
  • Adds an autorun in SessionsManagementService to keep IsActiveSessionArchivedContext in sync with session.isArchived.
Show a summary per file
File Description
src/vs/sessions/services/sessions/browser/sessionsManagementService.ts Binds and updates a new context key for active-session archived state; adds an autorun to react to isArchived changes.
src/vs/sessions/contrib/sessions/browser/views/sessionsViewActions.ts Adds “Restore” to the command center when the active session is archived; hides “Mark as Done” in that case; adds active-session fallback behavior for restore.
src/vs/sessions/common/contextkeys.ts Defines the new IsActiveSessionArchivedContext raw context key.

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 1

Comment thread src/vs/sessions/services/sessions/browser/sessionsManagementService.ts Outdated
Use a mutable wasArchived variable instead of a constant so that
openNewSessionView() fires correctly on restore→re-archive flows.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@osortega osortega marked this pull request as ready for review April 10, 2026 17:43
@osortega osortega enabled auto-merge (squash) April 10, 2026 17:51
@osortega osortega merged commit f5c39cb into main Apr 10, 2026
26 checks passed
@osortega osortega deleted the agents/recent-sole branch April 10, 2026 18:00
@vs-code-engineering vs-code-engineering Bot added this to the 1.116.0 milestone Apr 10, 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.

Agents: Hide or alter Done checkmark button when session is already marked as done

3 participants