Skip to content

Honor Explorer's minItems for the Windows taskbar jump list#318117

Open
SixFive7 wants to merge 2 commits into
microsoft:mainfrom
SixFive7:fix/respect-windows-jumplist-minitems
Open

Honor Explorer's minItems for the Windows taskbar jump list#318117
SixFive7 wants to merge 2 commits into
microsoft:mainfrom
SixFive7:fix/respect-windows-jumplist-minitems

Conversation

@SixFive7
Copy link
Copy Markdown

Fixes #318116.

What's broken

The Windows taskbar jump list's "Recent Folders & Workspaces" category is hardcoded to at most 7 entries, regardless of what Explorer requests via the Windows Shell jump list API. This violates the contract (ICustomDestinationList::BeginList's pcMinSlots, surfaced in Electron as app.getJumpListSettings().minItems) and ignores the user's Start_JumpListItems configuration that Windows passes to applications precisely so they can honor it.

The machinery to read the right value is already in place. updateWindowsJumpList() calls app.getJumpListSettings() and uses removedItems from the result, but discards minItems on the same return value.

The same jump list contains a sibling category (type: 'recent', OS-managed, populated automatically with recent files) that has always honored minItems from Explorer. So today users see two adjacent sections in the same jump list behaving differently for no documented reason.

Fix

Pass jumpListSettings.minItems to the slice call instead of the hardcoded constant. Delete the now-unused MAX_WINDOWS_JUMP_LIST_ENTRIES. Hoist app.getJumpListSettings() to a local so the same call feeds both removedItems and minItems.

Net diff: 4 insertions, 5 deletions.

Behavior

Slot count Explorer requests Before After
10 (Windows default) 7 shown 10 shown
30 7 shown 30 shown
Less than 7 7 shown The requested count shown

Brings the custom "Recent Folders & Workspaces" category into the same behavior as the sibling "Recent" (files) category that already honors minItems.

Verification

Built locally on Windows 11 (Node 22.22.1, MSVC v143 + Spectre, Python 3.12) and ran the source build. With Start_JumpListItems = 30:

  • history.recentlyOpenedPathsList contained 10 entries after opening 10 distinct folders.
  • The taskbar jump list "Recent Folders" category showed all 10 entries.
  • Before this patch the same scenario showed exactly 7 entries (the hardcoded cap).

Type-checks pass (npm run compile finishes with 0 errors).

Notes for reviewers

  • No new VS Code setting introduced.
  • Windows-only behavior is preserved (still guarded by isWindows).
  • The fix is purely on the main process side; no renderer changes.
  • The constant is deleted entirely; no rename or backwards-compat shim.

updateWindowsJumpList() already calls app.getJumpListSettings() to read
removedItems, but discards minItems on the same return value and slices
the recents list with a hardcoded 7. Pass minItems to slice instead and
drop the now-unused MAX_WINDOWS_JUMP_LIST_ENTRIES constant.

This brings the custom "Recent Folders & Workspaces" category in line
with the sibling 'recent' (files) category in the same jump list, which
has always honored minItems from Explorer.
Copilot AI review requested due to automatic review settings May 23, 2026 16:55
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

Note

Copilot was unable to run its full agentic suite in this review.

Updates Windows Jump List population to honor the slot count reported by Electron/Explorer, and reduces redundant API calls.

Changes:

  • Cache app.getJumpListSettings() and reuse it for removed-items processing and sizing.
  • Replace the fixed Windows Jump List entry cap with jumpListSettings.minItems.
  • Update the inline comment to explain the new sizing behavior.

Comment thread src/vs/platform/workspaces/electron-main/workspacesHistoryMainService.ts Outdated
Comment thread src/vs/platform/workspaces/electron-main/workspacesHistoryMainService.ts Outdated
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.

VS Code's taskbar jump list ignores getJumpListSettings().minItems and is hardcoded to 7 entries on Windows

3 participants