Skip to content

Feature: Enable drag and drop reordering for Pinned Sidebar items#18320

Open
kalmix wants to merge 1 commit intofiles-community:mainfrom
kalmix:feature/sidebar-drag-reorder
Open

Feature: Enable drag and drop reordering for Pinned Sidebar items#18320
kalmix wants to merge 1 commit intofiles-community:mainfrom
kalmix:feature/sidebar-drag-reorder

Conversation

@kalmix
Copy link
Copy Markdown
Contributor

@kalmix kalmix commented Mar 29, 2026

Resolved / Related Issues

Code Changes

  • Implemented direct drag-and-drop reordering for pinned sidebar items using the new IDraggableSidebarItemModel interface and the related sidebar drag/drop event flow updates.

  • Added UpdateOrderSilently and SuspendSync() to PinnedFoldersManager so 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) to BulkConcurrentObservableCollection so observable collections can shift items in place instead of forcing a full reload.

  • Added a force parameter to WindowsQuickAccessService.PinToSidebarAsync so 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 DragDropExceptionHelper for expected stale OLE/COM drag failures.

  • Hardened FilesystemHelpers to validate drag payload availability and safely handle dead OLE payload access without crashing the app.

  • Fixed a null crash in StorageFileExtensions.AreItemsAlreadyInFolder() by safely handling Path.GetDirectoryName(...) results before comparison.

  • Wrapped sidebar drag/drop deferral and payload access paths in guarded try/catch/finally flows 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

  1. Opened Files
  2. Pinned multiple folders to the sidebar
  3. Dragged a pinned folder to a different position in the sidebar
  4. Verified the folder drops and stays in the new position naturally
  5. Checked the Home Page Quick Access widget to confirm it matches the new order without flickering or reloading
  6. Opened Windows File Explorer in the background
  7. Started dragging a pinned folder in the sidebar to reorder it, and then quickly grabbed another sidebar item while the first drag was resolving
  8. Confirmed the app securely handles the underlying COMException and no longer crashes
  9. Restarted the app to verify the new pinned folder order persists

@kalmix kalmix force-pushed the feature/sidebar-drag-reorder branch 3 times, most recently from abd09bc to 7456ba8 Compare March 30, 2026 03:12
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.

Feature: Replace content dialog with sidebar drag and drop for rearranging pinned items

1 participant