Skip to content

Commit 02e450c

Browse files
committed
feat: Add solo mode functionality to repository toolbar
- Add a new localization string for solo mode functionality on HEAD. - Add a solo mode button to the repository toolbar for toggling the current head view. - Add solo commit filter mode for the current HEAD branch.
1 parent 04371a8 commit 02e450c

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

src/Resources/Locales/en_US.axaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,7 @@
655655
<x:String x:Key="Text.Repository.LocalBranches" xml:space="preserve">LOCAL BRANCHES</x:String>
656656
<x:String x:Key="Text.Repository.MoreOptions" xml:space="preserve">More options...</x:String>
657657
<x:String x:Key="Text.Repository.NavigateToCurrentHead" xml:space="preserve">Navigate to HEAD</x:String>
658+
<x:String x:Key="Text.Repository.SoloModeOnCurrentHead" xml:space="preserve">Solo On HEAD</x:String>
658659
<x:String x:Key="Text.Repository.NewBranch" xml:space="preserve">Create Branch</x:String>
659660
<x:String x:Key="Text.Repository.Notifications.Clear" xml:space="preserve">CLEAR NOTIFICATIONS</x:String>
660661
<x:String x:Key="Text.Repository.OnlyHighlightCurrentBranchInGraph" xml:space="preserve">Only highlight current branch</x:String>

src/Views/RepositoryToolbar.axaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@
132132
<Button Classes="icon_button" Width="32" Click="NavigateToHead" ToolTip.Tip="{DynamicResource Text.Repository.NavigateToCurrentHead}">
133133
<Path Width="13" Height="13" Margin="0,2,0,0" Data="{StaticResource Icons.Target}" Fill="{DynamicResource Brush.FG1}"/>
134134
</Button>
135+
<Button Classes="icon_button" Width="32" Click="SoloModeOnCurrentHead" ToolTip.Tip="{DynamicResource Text.Repository.SoloModeOnCurrentHead}">
136+
<Path Width="13" Height="13" Margin="0,2,0,0" Data="{StaticResource Icons.LightOn}" Fill="{DynamicResource Brush.FG1}"/>
137+
</Button>
135138
</StackPanel>
136139
</Grid>
137140
</UserControl>

src/Views/RepositoryToolbar.axaml.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,5 +462,14 @@ private void NavigateToHead(object sender, RoutedEventArgs e)
462462
e.Handled = true;
463463
}
464464
}
465+
466+
private void SoloModeOnCurrentHead(object sender, RoutedEventArgs e)
467+
{
468+
if (DataContext is ViewModels.Repository { CurrentBranch: not null } repo)
469+
{
470+
repo.SetSoloCommitFilterMode(repo.CurrentBranch.Head[..10], Models.FilterMode.Included);
471+
e.Handled = true;
472+
}
473+
}
465474
}
466475
}

0 commit comments

Comments
 (0)