Add manual drag-and-drop reordering for saved locations - #169
Open
daneden wants to merge 2 commits into
Open
Conversation
Adds a "Manual" sort option backed by a new `sortIndex` attribute on `SavedLocation`, introduced in a second model version so existing stores migrate lightweight. Dragging a row in any sort mode adopts the on-screen order as the manual order and switches to it, so the row stays where it was dropped. New locations append to the end of the manual order, and the order picker is hidden while sorting manually since reversing a hand-made order would only confuse the next drag. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SuVkpBmDxf4SmS9XbMh4Jf
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SuVkpBmDxf4SmS9XbMh4Jf
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.
Summary
Adds support for manual drag-and-drop reordering of saved locations. Users can now reorder locations by dragging them in the sidebar, with the order persisted to Core Data and synced across devices via CloudKit.
Key Changes
.manualcase toPreferences.SortingFunctionenum, allowing users to sort by their custom drag-and-drop orderSolstice 2.xcdatamodelwith newsortIndexattribute onSavedLocationto persist manual ordering.onMove()modifier toSidebarListViewto enable row reorderingmoveItems()method that persists reorder operations and automatically switches to manual sort modenextSortIndex()helper to assign sort indices to newly created locationsSortSignatureto includesortIndicesso reorders synced from other devices trigger re-sortingContentViewImplementation Details
sortIndexof 0) to maintain stable sortinghttps://claude.ai/code/session_01SuVkpBmDxf4SmS9XbMh4Jf