sessions: show restore button instead of checkmark for done sessions#309058
Merged
sessions: show restore button instead of checkmark for done sessions#309058
Conversation
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>
Contributor
There was a problem hiding this comment.
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
IsActiveSessionArchivedContextto 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
SessionsManagementServiceto keepIsActiveSessionArchivedContextin sync withsession.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
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>
joshspicer
approved these changes
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 archivedMarkSessionAsDoneAction— hidden from the command center when the active session is already archivedUnarchiveSessionAction— added to the command center (with active-session fallback when invoked without context) so the restore button appears for done sessionssessionsManagementService— reactively updatesIsActiveSessionArchivedContextvia an autorun on the active session'sisArchivedobservableBefore / After
Fixes #307712