From 1928648d59c33fea8d3557382848e54caeabd7be Mon Sep 17 00:00:00 2001 From: Goran Radosevic Date: Sun, 11 Oct 2026 13:44:38 +0200 Subject: [PATCH] ux: option to show staged changes above unstaged changes (#2698) Adds a preference (General > "Show staged changes above unstaged changes", default off) that swaps the two panes in the Local Changes view. The stage/unstage arrow buttons follow the layout: with staged on top, stage points up and unstage points down. Implemented with bindings on Grid.Row and the icon geometry, no code-behind changes. English string only. --- src/Converters/BoolConverters.cs | 18 ++++++++++++++++++ src/Resources/Locales/en_US.axaml | 1 + src/ViewModels/Preferences.cs | 7 +++++++ src/Views/Preferences.axaml | 9 +++++++-- src/Views/WorkingCopy.axaml | 12 ++++++------ 5 files changed, 39 insertions(+), 8 deletions(-) diff --git a/src/Converters/BoolConverters.cs b/src/Converters/BoolConverters.cs index 5c5dd9047e..5a917281d7 100644 --- a/src/Converters/BoolConverters.cs +++ b/src/Converters/BoolConverters.cs @@ -15,5 +15,23 @@ public static class BoolConverters public static readonly FuncValueConverter IsWarningToBrush = new(x => x ? Brushes.DarkGoldenrod : Application.Current?.FindResource("Brush.FG1") as IBrush); + + public static readonly FuncValueConverter IsStagedOnTopToUnstagedRow = + new(x => x ? 3 : 1); + + public static readonly FuncValueConverter IsStagedOnTopToStagedRow = + new(x => x ? 1 : 3); + + public static readonly FuncValueConverter IsStagedOnTopToStageIcon = + new(x => Application.Current?.FindResource(x ? "Icons.Up" : "Icons.Down") as StreamGeometry); + + public static readonly FuncValueConverter IsStagedOnTopToStageAllIcon = + new(x => Application.Current?.FindResource(x ? "Icons.DoubleUp" : "Icons.DoubleDown") as StreamGeometry); + + public static readonly FuncValueConverter IsStagedOnTopToUnstageIcon = + new(x => Application.Current?.FindResource(x ? "Icons.Down" : "Icons.Up") as StreamGeometry); + + public static readonly FuncValueConverter IsStagedOnTopToUnstageAllIcon = + new(x => Application.Current?.FindResource(x ? "Icons.DoubleDown" : "Icons.DoubleUp") as StreamGeometry); } } diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 76ac9e4dcb..db3fae5925 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -702,6 +702,7 @@ Show `LOCAL CHANGES` page by default Show `CHANGES` tab in commit detail by default Show relative time in commit graph + Show staged changes above unstaged changes Show tags in commit graph Subject Guide Length 24-Hours diff --git a/src/ViewModels/Preferences.cs b/src/ViewModels/Preferences.cs index 4803ec4296..f2854784bd 100644 --- a/src/ViewModels/Preferences.cs +++ b/src/ViewModels/Preferences.cs @@ -295,6 +295,12 @@ public int ImageDiffActiveIdx set => SetProperty(ref _imageDiffActiveIdx, value); } + public bool ShowStagedChangesOnTop + { + get => _showStagedChangesOnTop; + set => SetProperty(ref _showStagedChangesOnTop, value); + } + public bool EnableCompactFoldersInChangesTree { get => _enableCompactFoldersInChangesTree; @@ -830,6 +836,7 @@ private bool RemoveInvalidRepositoriesRecursive(List collection) private string _ignoreUpdateTag = string.Empty; private bool _showTagsInGraph = true; + private bool _showStagedChangesOnTop = false; private bool _useTwoColumnsLayoutInHistories = false; private bool _displayTimeAsPeriodInHistories = false; private bool _useSideBySideDiff = false; diff --git a/src/Views/Preferences.axaml b/src/Views/Preferences.axaml index 55c2b17276..3ac18ebd2f 100644 --- a/src/Views/Preferences.axaml +++ b/src/Views/Preferences.axaml @@ -47,7 +47,7 @@ - + + + - - + @@ -129,7 +129,7 @@ VerticalAlignment="Center"/> - + @@ -164,7 +164,7 @@ Focusable="False"/> - + @@ -185,10 +185,10 @@ Foreground="{DynamicResource MenuFlyoutItemKeyboardAcceleratorTextForeground}"/> - +