sessions: rename "No Workspace" group to "Unknown"#305352
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Renames the fallback workspace group label used by the Sessions list grouping logic when a session has no associated workspace, and updates the related unit test expectations.
Changes:
- Updated
groupByWorkspace()fallback label from “No Workspace” to “Unknown”. - Updated the
groupByWorkspacehelper test description and expected labels to match.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/vs/sessions/contrib/sessions/browser/views/sessionsList.ts | Changes the localized fallback workspace group label used during grouping. |
| src/vs/sessions/contrib/sessions/test/browser/sessionsList.test.ts | Updates test text and assertions for the new fallback label. |
Comments suppressed due to low confidence (1)
src/vs/sessions/contrib/sessions/browser/views/sessionsList.ts:1186
- The fallback group label is now "Unknown", and
groupByWorkspaceuses the label both as the Map key and to form the section id (id: workspace:${label}). This increases the chance of collisions with a real workspace actually named "Unknown", which can break section identity and collapse-state persistence (two different groups end up sharing the same id). Consider using a stable, non-display identifier for grouping/ids (e.g. a dedicated sentinel id for the missing-workspace group) and keep the localized label purely for display.
const workspace = session.workspace.get();
const label = workspace?.label ?? localize('unknown', "Unknown");
let group = groups.get(label);
if (!group) {
group = [];
groups.set(label, group);
}
group.push(session);
}
const order = [...groups.keys()].sort((a, b) => a.localeCompare(b));
return order.map(label => ({
id: `workspace:${label}`,
label,
Yoyokrazy
previously approved these changes
Mar 26, 2026
mjbvz
approved these changes
Mar 27, 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
Renames the fallback workspace group label in the sessions list from "No Workspace" to "Unknown" for sessions that don't have an associated workspace.
Changes
src/vs/sessions/contrib/sessions/browser/views/sessionsList.ts— UpdatedgroupByWorkspace()fallback label from"No Workspace"to"Unknown"src/vs/sessions/contrib/sessions/test/browser/sessionsList.test.ts— Updated test description and assertion to match the new label