Skip to content

Conversation

@ivnnv
Copy link

@ivnnv ivnnv commented Feb 1, 2026

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

  • Adds drag-and-drop reordering for the sidebar view switcher (History, Working Copy, Stashes)
  • Adds a grip handle icon to each section for discoverability
  • Persists the custom order in preference.json via LayoutInfo.SidebarViewOrder
  • Follows existing drag-and-drop patterns used in LauncherTabBar and Welcome

Changes

  • LayoutInfo.cs: New SidebarViewOrder property (List<int>, default [0, 1, 2])
  • Repository.axaml: Grip handle + drag-drop attributes on each ListBoxItem, manual selection handling
  • Repository.axaml.cs: Drag-drop handlers, order persistence, selection sync with ViewModel
  • Icons.axaml: New Icons.GripVertical icon for the drag handle
  • App.JsonCodeGen.cs: Registered List<int> for JSON serialization

Test plan

  • Drag grip handle to reorder History, Working Copy, Stashes
  • Order persists after closing and reopening the app
  • Selection continues to work correctly after reordering
  • Programmatic SelectedViewIndex changes (keyboard shortcuts, merge conflicts) sync correctly
  • Verify on Windows and Linux

Allow users to reorder History, Working Copy, and Stashes sections
in the sidebar via drag-and-drop. Order persists across sessions.
@ivnnv ivnnv force-pushed the feature/sidebar-section-reorder branch from 6d8bbc3 to 00d6be8 Compare February 1, 2026 17:13
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.

1 participant