Skip to content

Fix: Remove the option to Pin to Sidebar for the Libraries root - #18928

Open
JorgChrist wants to merge 1 commit into
files-community:mainfrom
JorgChrist:fix/16857-pin-libraries-root
Open

Fix: Remove the option to Pin to Sidebar for the Libraries root#18928
JorgChrist wants to merge 1 commit into
files-community:mainfrom
JorgChrist:fix/16857-pin-libraries-root

Conversation

@JorgChrist

Copy link
Copy Markdown

Resolved / Related Issues

Steps used to test these changes

  1. Opened Files and navigated to %APPDATA%\Microsoft\Windows\Libraries. "Pin to Sidebar" is no longer an option.
  2. Navigated to %APPDATA%\Microsoft\Windows, selected the Libraries folder and opened the context menu. Also no longer an option.
  3. Pinned and unpinned an ordinary folder. Works as before.
  4. Confirmed the individual libraries (Documents, Music etc.) can still be pinned.

Context

Full investigation is in the comment of issue #16857. Windows silently refuses the pintohome verb for the Libraries root when it's invoked programmatically: IContextMenu::InvokeCommand returns S_OK and nothing is written to Quick Access. It's not specific to Files, invoking the same verb through Shell.Application from PowerShell behaves identically. File Explorer can create the pin but once it exists it can't be removed again from Files, Explorer or Shell.Application, so a user who tries this ends up with a sidebar entry they can only get rid of by deleting the Quick Access store.

Since the pin can never succeed, hiding the option seemed better than letting it silently do nothing. This matches how ContentPageTypes.RecycleBin is already handled at the top of GetIsExecutable.

One thing I'd like input on

This covers the case where the folder is addressed by its file system path. When it's reached through the shell namespace (shell:Libraries), ItemPath is the \\SHELL\<base64 PIDL> form instead and isn't caught, so the option still shows there.
I left it out because catching it means decoding the PIDL inside a synchronous predicate and I didn't want to add that without asking. I can fix that as well if you are okay with it.

@CLAassistant

CLAassistant commented Sep 7, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@yair100
yair100 force-pushed the main branch 5 times, most recently from 0b848cc to 3a7c7ed Compare September 7, 2026 22:51
@JorgChrist
JorgChrist force-pushed the fix/16857-pin-libraries-root branch from 3b3a36c to b28b5a5 Compare September 8, 2026 08:36
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.

2 participants