feat: drag-to-reorder sidebar view switcher sections #2086
+251
−22
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.
Hi! I recently jumped off Sourcetree after dealing with how slow it is, random crashes, and probably more things that made this repo exist in the first place. So first of all, thanks to the creator and maintainers for having this open sourced, its been great so far.
One of the frictions I found during the switch is that the sidebar sections (History, Local Changes, Stashes) are in a fixed order and I'm used to having Local Changes first since its the section I use the most.
This PR adds drag-to-reorder for those sections, with the order persisting across sessions. It follows the existing drag-and-drop patterns already in the codebase so it felt like a good first contribution, more to come later probably!
DEMO:
sort-sections.mov
Summary
preference.jsonviaLayoutInfo.SidebarViewOrderLauncherTabBarandWelcomeChanges
LayoutInfo.cs: NewSidebarViewOrderproperty (List<int>, default[0, 1, 2])Repository.axaml: Grip handle + drag-drop attributes on each ListBoxItem, manual selection handlingRepository.axaml.cs: Drag-drop handlers, order persistence, selection sync with ViewModelIcons.axaml: NewIcons.GripVerticalicon for the drag handleApp.JsonCodeGen.cs: RegisteredList<int>for JSON serializationTest plan
SelectedViewIndexchanges (keyboard shortcuts, merge conflicts) sync correctly