Agents: fix sessions workspace picker#312136
Merged
Conversation
- Filter copilot worktrees (folders starting with 'copilot-') from VS Code recents - Preserve VS Code recents order instead of sorting alphabetically - Fix overflow with description + group title in inline-description mode - Fix submenu chevron alignment using flex layout without negative margins - Cap picker width at 600px (matching quick pick) with stable fixed-width layout that skips DOM measurement to prevent width fluctuating with window height - Add 30px bottom gap so picker doesn't grow flush to window edge - Add scrollbar clearance: row width calc(100% - 10px) keeps content clear of the 10px overlay scrollbar track - Fix group title / toolbar spacing in inline-description mode - Document entry ordering in _buildItems() Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Manual path.lastIndexOf('/') returns empty string when the URI path
has a trailing slash, causing the filter to miss those folders.
Use the existing basename() helper from resources.ts which handles
all URI path edge cases correctly.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes several UX and ordering issues in the Agents window “sessions workspace picker”, primarily by stabilizing picker sizing/spacing and adjusting how recent workspaces are sourced and ordered.
Changes:
- Adds a fixed-width option for action lists and uses it in the sessions workspace picker to prevent resize-induced width fluctuations.
- Updates action widget styling to keep row content clear of the overlay scrollbar and refines inline-description spacing.
- Adjusts sessions workspace picker recents behavior: preserves VS Code recents order and filters out certain internal Copilot worktrees.
Show a summary per file
| File | Description |
|---|---|
| src/vs/sessions/contrib/chat/browser/sessionWorkspacePicker.ts | Preserves recents ordering, filters Copilot worktree recents, adds picker JSDoc, and sets a fixed picker width via action list options. |
| src/vs/platform/actionWidget/browser/actionWidget.css | Tweaks action-widget row sizing and inline-description layout to improve scrollbar clearance and spacing. |
| src/vs/platform/actionWidget/browser/actionList.ts | Introduces an options-driven “fixed width” path (via maxWidth) and adjusts height calculations to maintain a window-edge gap. |
Copilot's findings
Comments suppressed due to low confidence (2)
src/vs/platform/actionWidget/browser/actionList.ts:1773
- There’s test coverage for
ActionListWidgetfiltering, but the newly introducedmaxWidth/fixed-width behavior inActionList.layout()(and the new bottom-gap height behavior) is untested. Adding a small browser test that asserts the returned width/layout behavior whenmaxWidthis set (including in a constrained container) would help prevent regressions.
// When a fixed maxWidth is provided, skip DOM measurement entirely.
// DOM-based measurement varies with scrollbar presence (which depends on
// the list height), causing the width to fluctuate as the window is resized.
let computedWidth: number;
if (this._options?.maxWidth !== undefined) {
computedWidth = this._options.maxWidth;
} else {
computedWidth = this._widget.computeMaxWidth(minWidth);
}
this._cachedMaxWidth = computedWidth;
this._widget.layout(listHeight, this._cachedMaxWidth);
src/vs/platform/actionWidget/browser/actionList.ts:1771
- When
options.maxWidthis set,layout()forces the widget width to that value without respectingminWidthor the widget’s CSS constraints (e.g..action-widget { max-width: 80vw; }). In narrow windows this can cause a mismatch where the DOM clamps the widget width but the list is laid out as if it were wider, leading to clipped content/incorrect scrolling. Consider clamping the fixed width to the effective available width (e.g. viewport/CSS max) and also honoring the effective min width.
if (this._options?.maxWidth !== undefined) {
computedWidth = this._options.maxWidth;
} else {
computedWidth = this._widget.computeMaxWidth(minWidth);
}
- Files reviewed: 3/3 changed files
- Comments generated: 3
Contributor
Only show the 10 most recent folders from VS Code history in the workspace picker to keep the list focused and manageable. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Rename maxWidth option to fixedWidth to accurately reflect its behavior (fixed width, not a cap on measured width) - Fix spaceAbove calculation: remove bottomGap from spaceAbove since the 30px gap is only needed at the bottom of the viewport - _isCopilotWorktree already uses basename() from a prior commit Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move the cap from _loadVSCodeRecentFolders (before provider resolution) into _getVSCodeRecentWorkspaces (after provider filtering), so unsupported folders don't consume slots in the limit. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
lszomoru
previously approved these changes
Apr 23, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
lszomoru
previously approved these changes
Apr 23, 2026
Member
|
Can you confirm if the fixture change is intentional? I believe it is caused by that: (disabled auto-merge as precautionary measure, feel free to merge nontheless) |
Member
Author
|
Hey - this is a great catch - I will fix it |
…duction Replace width: calc(100% - 10px) on rows with margin-right: 10px on the toolbar, submenu chevron, and group-title (when no actions follow). This avoids shrinking the row itself which caused code action list screenshot regressions, while still providing scrollbar clearance. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
lszomoru
approved these changes
Apr 23, 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.
Fixes several issues with the sessions workspace picker in the Agents window.
Changes
Filter copilot worktrees from VS Code recents
Folders whose name starts with
copilot-are filtered out from the VS Code recent folders list, as these are internal worktrees and not user-facing workspaces.Preserve VS Code recents order
Removed the alphabetical sort that was previously applied to VS Code recent folders. Entries now retain the order VS Code stores them in (most recently used first).
Stable picker width
When
maxWidthis set on the action list options, DOM-based width measurement is now skipped entirely and the fixed value is used directly. Previously, the measured width varied with scrollbar presence (which depended on list height which depended on window height), causing the picker width to fluctuate when the window was resized.Scrollbar clearance
Row width is set to
calc(100% - 10px)so content never extends under the 10px Monaco overlay scrollbar track.Group title / toolbar spacing
In inline-description mode, the flex row gap is set to
0with explicit margins on individual elements. This keeps the group title ("Folders") and remove button (×) flush with just a small readable gap, while still giving the group titlemargin-rightbreathing room when the toolbar is hidden.Bottom gap
A 30px gap is maintained between the bottom of the picker and the window edge.
Document entry ordering
Added JSDoc on
_buildItems()explaining the sorting: own recents first, VS Code recents after, groups ordered by first appearance, within-group order preserved.