Feature: Enable drag and drop reordering for Pinned Sidebar items#18320
Feature: Enable drag and drop reordering for Pinned Sidebar items#18320kalmix wants to merge 4 commits intofiles-community:mainfrom
Conversation
abd09bc to
7456ba8
Compare
|
@kalmix I haven't reviewed the code yet, but I tested the changes. It works pretty well but I noticed that I can't drag Recycle Bin to a different position. I'm not sure if this is specific to Recycle Bin or if it's because it's the last item in the list. As a side note, can you remove the old content dialog since it's no longer needed? |
|
@yair100 Sorry, I missed |
176a3c0 to
fff0cd5
Compare
|
I've also updated the "drop on center" behavior to better align with the Explorer. For pinned items, dropping on the center now performs a Create Link action instead of a move operation, while non-pinned items continue to be moved as before. In addition, I added support for drag-and-drop pinning. |
|
Seems to be no way to drag an item to the first position. I have to drag the item to the second from top and then the first one down. Also has issues keeping Gallery pined when the list is updated |
…ss sync - Fix sidebar drag-to-top missing item UI virtualization bug by replacing .Move() with a data reset Manager_DataChanged, which allows drag reordering to the very first position. - Resolve Gallery unpinning failures by explicitly normalizing Windows Virtual Folder PIDL paths (stripping \\SHELL\) and implementing a fallback remove COM verb for virtual shell folders that ignore the standard unpinfromhome verb. - Eliminate race conditions over Quick Access pinning by introducing a FileSystemWatcher in WaitUntilAsync on the OS automaticDestinations-ms registry. - Update LocationItem to correctly display friendly hover tooltips for virtual folders instead of exposing their raw path.
|
@Josh65-2201 Yes, sorry I blocked users from draging to the top because I was running into a UI virtualization bug that left a blank space and also because the file explorer doesn't allow you to do that either but now i've fixed it using Regarding the Gallery issue, thanks for pointing that out, in this case Gallery is an outlier that also causes problem with the current state of Files (try it on the prod app), I gave my best shot at fixing this by normalizing the PIDL paths and also adding a fallback remove COM verb and then to keep everything in sync I added a FileSystemWatcher that tracks the Quick Access registry. |
|
Working perfectly now. |
Resolved / Related Issues
Code Changes
Implemented direct drag-and-drop reordering for pinned sidebar items using the new
IDraggableSidebarItemModelinterface and the related sidebar drag/drop event flow updates.Added
UpdateOrderSilentlyandSuspendSync()toPinnedFoldersManagerso pinned items can be reordered safely while temporarily pausing sync side effects.Updated the Home Page Quick Access widget to reorder items with
Items.Move()instead of clearing and rebuilding the collection, reducing UI flicker during reorder operations.Added
Move(int oldIndex, int newIndex)toBulkConcurrentObservableCollectionso observable collections can shift items in place instead of forcing a full reload.Added a
forceparameter toWindowsQuickAccessService.PinToSidebarAsyncso Windows Shell pins can be reapplied in the exact intended order when syncing reorder changes back to the OS.Replaced the previous app-level COM exception workaround with localized drag-and-drop exception handling in the sidebar pipeline, including a dedicated
DragDropExceptionHelperfor expected stale OLE/COM drag failures.Hardened
FilesystemHelpersto validate drag payload availability and safely handle dead OLE payload access without crashing the app.Fixed a null crash in
StorageFileExtensions.AreItemsAlreadyInFolder()by safely handlingPath.GetDirectoryName(...)results before comparison.Wrapped sidebar drag/drop deferral and payload access paths in guarded
try/catch/finallyflows so interrupted or stale drops fail gracefully instead of tearing down the app.Before:
before.mp4
After:
after.mp4
Steps used to test these changes
COMExceptionand no longer crashes