From b07e2c2f5f2b2fa2385f79a96592be0ae76f00da Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 25 Aug 2025 11:34:04 +0800 Subject: [PATCH 01/55] feature: add a new button `Paste (Replace all)` to paste commit message from clipboard (#1169) Signed-off-by: leo --- src/Resources/Locales/en_US.axaml | 1 + src/Resources/Locales/zh_CN.axaml | 1 + src/Resources/Locales/zh_TW.axaml | 1 + src/Views/CommitMessageTextBox.axaml | 13 +++++++++++-- src/Views/CommitMessageTextBox.axaml.cs | 20 ++++++++++++++++++++ 5 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 562fb190..98334853 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -166,6 +166,7 @@ Signer: Open in Browser Description + Paste (Replace all) SUBJECT Enter commit subject Repository Configure diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 18e4cf47..59d06e3e 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -170,6 +170,7 @@ 签名者 : 浏览器中查看 详细描述 + 粘贴(替换全部) 主题 填写提交信息主题 仓库配置 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 30666ab1..78539749 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -170,6 +170,7 @@ 簽署人: 在瀏覽器中檢視 詳細描述 + 粘貼(替換所有內容) 標題 填寫提交訊息標題 存放庫設定 diff --git a/src/Views/CommitMessageTextBox.axaml b/src/Views/CommitMessageTextBox.axaml index 794ebaa4..8d99bf66 100644 --- a/src/Views/CommitMessageTextBox.axaml +++ b/src/Views/CommitMessageTextBox.axaml @@ -66,7 +66,7 @@ Background="{DynamicResource Brush.Window}" BorderThickness="1,0,0,0" CornerRadius="0,0,4,4"> - + - + + + + 1 ? $"{subject}\n\n{parts[1].Trim()}" : subject; + } + } + catch + { + // Ignore exceptions. + } + + e.Handled = true; + } + private TextChangeWay _changingWay = TextChangeWay.None; } } From b135d590dee82bc75def59a5280884c0bc9e6de3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 25 Aug 2025 03:34:41 +0000 Subject: [PATCH 02/55] doc: Update translation status and sort locale files --- TRANSLATION.md | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/TRANSLATION.md b/TRANSLATION.md index 8593e981..071076f6 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -6,29 +6,31 @@ This document shows the translation status of each locale file in the repository ### ![en_US](https://img.shields.io/badge/en__US-%E2%88%9A-brightgreen) -### ![de__DE](https://img.shields.io/badge/de__DE-99.65%25-yellow) +### ![de__DE](https://img.shields.io/badge/de__DE-99.54%25-yellow)
Missing keys in de_DE.axaml +- Text.CommitMessageTextBox.PasteAndReplaceAll - Text.Preferences.General.ShowChangesPageByDefault - Text.WorkingCopy.ClearCommitHistories - Text.WorkingCopy.ClearCommitHistories.Confirm
-### ![es__ES](https://img.shields.io/badge/es__ES-99.65%25-yellow) +### ![es__ES](https://img.shields.io/badge/es__ES-99.54%25-yellow)
Missing keys in es_ES.axaml +- Text.CommitMessageTextBox.PasteAndReplaceAll - Text.Preferences.General.ShowChangesPageByDefault - Text.WorkingCopy.ClearCommitHistories - Text.WorkingCopy.ClearCommitHistories.Confirm
-### ![fr__FR](https://img.shields.io/badge/fr__FR-80.07%25-yellow) +### ![fr__FR](https://img.shields.io/badge/fr__FR-79.98%25-yellow)
Missing keys in fr_FR.axaml @@ -76,6 +78,7 @@ This document shows the translation status of each locale file in the repository - Text.CommitDetail.Changes.Count - Text.CommitDetail.Info.Key - Text.CommitDetail.Info.Signer +- Text.CommitMessageTextBox.PasteAndReplaceAll - Text.CommitMessageTextBox.SubjectCount - Text.Configure.CommitMessageTemplate.BuiltinVars - Text.Configure.CustomAction.Arguments.Tip @@ -209,11 +212,12 @@ This document shows the translation status of each locale file in the repository
-### ![it__IT](https://img.shields.io/badge/it__IT-99.54%25-yellow) +### ![it__IT](https://img.shields.io/badge/it__IT-99.42%25-yellow)
Missing keys in it_IT.axaml +- Text.CommitMessageTextBox.PasteAndReplaceAll - Text.Preferences.General.EnableCompactFolders - Text.Preferences.General.ShowChangesPageByDefault - Text.WorkingCopy.ClearCommitHistories @@ -221,7 +225,7 @@ This document shows the translation status of each locale file in the repository
-### ![ja__JP](https://img.shields.io/badge/ja__JP-80.07%25-yellow) +### ![ja__JP](https://img.shields.io/badge/ja__JP-79.98%25-yellow)
Missing keys in ja_JP.axaml @@ -270,6 +274,7 @@ This document shows the translation status of each locale file in the repository - Text.CommitDetail.Changes.Count - Text.CommitDetail.Info.Key - Text.CommitDetail.Info.Signer +- Text.CommitMessageTextBox.PasteAndReplaceAll - Text.CommitMessageTextBox.SubjectCount - Text.Configure.CommitMessageTemplate.BuiltinVars - Text.Configure.CustomAction.Arguments.Tip @@ -402,7 +407,7 @@ This document shows the translation status of each locale file in the repository
-### ![pt__BR](https://img.shields.io/badge/pt__BR-73.39%25-red) +### ![pt__BR](https://img.shields.io/badge/pt__BR-73.30%25-red)
Missing keys in pt_BR.axaml @@ -463,6 +468,7 @@ This document shows the translation status of each locale file in the repository - Text.CommitDetail.Info.Children - Text.CommitDetail.Info.Key - Text.CommitDetail.Info.Signer +- Text.CommitMessageTextBox.PasteAndReplaceAll - Text.CommitMessageTextBox.SubjectCount - Text.Configure.CommitMessageTemplate.BuiltinVars - Text.Configure.CustomAction.Arguments.Tip @@ -641,9 +647,16 @@ This document shows the translation status of each locale file in the repository
-### ![ru__RU](https://img.shields.io/badge/ru__RU-%E2%88%9A-brightgreen) +### ![ru__RU](https://img.shields.io/badge/ru__RU-99.88%25-yellow) -### ![ta__IN](https://img.shields.io/badge/ta__IN-80.18%25-yellow) +
+Missing keys in ru_RU.axaml + +- Text.CommitMessageTextBox.PasteAndReplaceAll + +
+ +### ![ta__IN](https://img.shields.io/badge/ta__IN-80.09%25-yellow)
Missing keys in ta_IN.axaml @@ -692,6 +705,7 @@ This document shows the translation status of each locale file in the repository - Text.CommitDetail.Changes.Count - Text.CommitDetail.Info.Key - Text.CommitDetail.Info.Signer +- Text.CommitMessageTextBox.PasteAndReplaceAll - Text.CommitMessageTextBox.SubjectCount - Text.Configure.CommitMessageTemplate.BuiltinVars - Text.Configure.CustomAction.Arguments.Tip @@ -823,7 +837,7 @@ This document shows the translation status of each locale file in the repository
-### ![uk__UA](https://img.shields.io/badge/uk__UA-81.34%25-yellow) +### ![uk__UA](https://img.shields.io/badge/uk__UA-81.24%25-yellow)
Missing keys in uk_UA.axaml @@ -871,6 +885,7 @@ This document shows the translation status of each locale file in the repository - Text.CommitDetail.Changes.Count - Text.CommitDetail.Info.Key - Text.CommitDetail.Info.Signer +- Text.CommitMessageTextBox.PasteAndReplaceAll - Text.CommitMessageTextBox.SubjectCount - Text.Configure.CommitMessageTemplate.BuiltinVars - Text.Configure.CustomAction.Arguments.Tip From 14adc2361a0b2da23ca2c5aae39d7725595ccda7 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 25 Aug 2025 12:39:01 +0800 Subject: [PATCH 03/55] enhance: warn users if they are using `vimdiff` or `nvimdiff` as external merge/diff tool (#1742) Signed-off-by: leo --- src/Commands/DiffTool.cs | 33 ++++++++++++++++++++++++++++++++- src/Commands/MergeTool.cs | 33 ++++++++++++++++++++++++++++++--- 2 files changed, 62 insertions(+), 4 deletions(-) diff --git a/src/Commands/DiffTool.cs b/src/Commands/DiffTool.cs index a7dec1b4..5bc23db3 100644 --- a/src/Commands/DiffTool.cs +++ b/src/Commands/DiffTool.cs @@ -17,12 +17,15 @@ namespace SourceGit.Commands var tool = Native.OS.GetDiffMergeTool(true); if (tool == null) { - App.RaiseException(Context, "Invalid merge tool in preference setting!"); + App.RaiseException(Context, "Invalid diff/merge tool in preference setting!"); return; } if (string.IsNullOrEmpty(tool.Cmd)) { + if (!CheckGitConfiguration()) + return; + Args = $"difftool -g --no-prompt {_option}"; } else @@ -41,6 +44,34 @@ namespace SourceGit.Commands } } + private bool CheckGitConfiguration() + { + var config = new Config(WorkingDirectory).ReadAll(); + if (config.TryGetValue("diff.guitool", out var guiTool)) + return CheckCLIBasedTool(guiTool); + if (config.TryGetValue("merge.guitool", out var mergeGuiTool)) + return CheckCLIBasedTool(mergeGuiTool); + if (config.TryGetValue("diff.tool", out var diffTool)) + return CheckCLIBasedTool(diffTool); + if (config.TryGetValue("merge.tool", out var mergeTool)) + return CheckCLIBasedTool(mergeTool); + + App.RaiseException(Context, "Missing git configuration: diff.guitool"); + return false; + } + + private bool CheckCLIBasedTool(string tool) + { + if (tool.StartsWith("vimdiff", StringComparison.Ordinal) || + tool.StartsWith("nvimdiff", StringComparison.Ordinal)) + { + App.RaiseException(Context, $"CLI based diff tool \"{tool}\" is not supported by this app!"); + return false; + } + + return true; + } + private Models.DiffOption _option; } } diff --git a/src/Commands/MergeTool.cs b/src/Commands/MergeTool.cs index e3da590d..0f15fb61 100644 --- a/src/Commands/MergeTool.cs +++ b/src/Commands/MergeTool.cs @@ -1,4 +1,5 @@ -using System.Threading.Tasks; +using System; +using System.Threading.Tasks; namespace SourceGit.Commands { @@ -16,13 +17,17 @@ namespace SourceGit.Commands var tool = Native.OS.GetDiffMergeTool(false); if (tool == null) { - App.RaiseException(Context, "Invalid merge tool in preference setting!"); + App.RaiseException(Context, "Invalid diff/merge tool in preference setting!"); return false; } if (string.IsNullOrEmpty(tool.Cmd)) { - Args = $"mergetool {_file}"; + var ok = await CheckGitConfigurationAsync(); + if (!ok) + return false; + + Args = $"mergetool -g --no-prompt {_file}"; } else { @@ -33,6 +38,28 @@ namespace SourceGit.Commands return await ExecAsync().ConfigureAwait(false); } + private async Task CheckGitConfigurationAsync() + { + var tool = await new Config(WorkingDirectory).GetAsync("merge.guitool"); + if (string.IsNullOrEmpty(tool)) + tool = await new Config(WorkingDirectory).GetAsync("merge.tool"); + + if (string.IsNullOrEmpty(tool)) + { + App.RaiseException(Context, "Missing git configuration: merge.guitool"); + return false; + } + + if (tool.StartsWith("vimdiff", StringComparison.Ordinal) || + tool.StartsWith("nvimdiff", StringComparison.Ordinal)) + { + App.RaiseException(Context, $"CLI based merge tool \"{tool}\" is not supported by this app!"); + return false; + } + + return true; + } + private string _file; } } From 39a49c42638036141019875be2e08bd356c82c8d Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 25 Aug 2025 14:39:11 +0800 Subject: [PATCH 04/55] ux: use `WrapPanel` instead of `VirtualizingStackPanel` for history filters (#1712) Signed-off-by: leo --- src/Views/Repository.axaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Views/Repository.axaml b/src/Views/Repository.axaml index 07567752..8046aceb 100644 --- a/src/Views/Repository.axaml +++ b/src/Views/Repository.axaml @@ -777,7 +777,7 @@ - + - + - + @@ -804,7 +804,8 @@ Margin="0,0,6,0" CornerRadius="12" BorderThickness="1" - BorderBrush="{Binding Mode, Converter={x:Static c:FilterModeConverters.ToBorderBrush}}"> + BorderBrush="{Binding Mode, Converter={x:Static c:FilterModeConverters.ToBorderBrush}}" + VerticalAlignment="Center"> From c631c2d1a4291e47b8e83aad7317c3d4f304cab4 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 25 Aug 2025 15:44:01 +0800 Subject: [PATCH 05/55] feature: auto-sanitize branch/tag name (#1753) Signed-off-by: leo --- src/Models/Branch.cs | 11 +---- src/Resources/Locales/de_DE.axaml | 1 - src/Resources/Locales/en_US.axaml | 1 - src/Resources/Locales/es_ES.axaml | 1 - src/Resources/Locales/fr_FR.axaml | 1 - src/Resources/Locales/it_IT.axaml | 1 - src/Resources/Locales/ja_JP.axaml | 1 - src/Resources/Locales/ru_RU.axaml | 1 - src/Resources/Locales/ta_IN.axaml | 1 - src/Resources/Locales/uk_UA.axaml | 1 - src/Resources/Locales/zh_CN.axaml | 1 - src/Resources/Locales/zh_TW.axaml | 1 - src/ViewModels/CreateBranch.cs | 16 ++++---- src/ViewModels/RenameBranch.cs | 12 +++--- src/Views/BranchOrTagNameTextBox.cs | 63 +++++++++++++++++++++++++++++ src/Views/CreateBranch.axaml | 32 ++++++--------- src/Views/CreateTag.axaml | 14 +++---- src/Views/RenameBranch.axaml | 23 ++++------- 18 files changed, 104 insertions(+), 78 deletions(-) create mode 100644 src/Views/BranchOrTagNameTextBox.cs diff --git a/src/Models/Branch.cs b/src/Models/Branch.cs index 350bc5b5..7146da3f 100644 --- a/src/Models/Branch.cs +++ b/src/Models/Branch.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using System.Text.RegularExpressions; namespace SourceGit.Models { @@ -30,7 +29,7 @@ namespace SourceGit.Models CommitterDate, } - public partial class Branch + public class Branch { public string Name { get; set; } public string FullName { get; set; } @@ -45,13 +44,5 @@ namespace SourceGit.Models public bool IsUpstreamGone { get; set; } public string FriendlyName => IsLocal ? Name : $"{Remote}/{Name}"; - - [GeneratedRegex(@"\s+")] - private static partial Regex REG_FIX_NAME(); - - public static string FixName(string name) - { - return REG_FIX_NAME().Replace(name, "-"); - } } } diff --git a/src/Resources/Locales/de_DE.axaml b/src/Resources/Locales/de_DE.axaml index 6f5f9414..80454e16 100644 --- a/src/Resources/Locales/de_DE.axaml +++ b/src/Resources/Locales/de_DE.axaml @@ -268,7 +268,6 @@ Stashen & wieder anwenden Neuer Branch-Name: Branch-Name - Leerzeichen werden durch Bindestriche ersetzt. Lokalen Branch erstellen Überschreibe existierenden Branch Tag erstellen... diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 98334853..6e16643f 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -264,7 +264,6 @@ Stash & Reapply New Branch Name: Enter branch name. - Spaces will be replaced with dashes. Create Local Branch Overwrite existing branch Create Tag... diff --git a/src/Resources/Locales/es_ES.axaml b/src/Resources/Locales/es_ES.axaml index 1db8d2a6..67a66d6f 100644 --- a/src/Resources/Locales/es_ES.axaml +++ b/src/Resources/Locales/es_ES.axaml @@ -267,7 +267,6 @@ Stash & Reaplicar Nombre de la Nueva Rama: Introduzca el nombre de la rama. - Los espacios serán reemplazados con guiones. Crear Rama Local Sobrescribir la rama existente Crear Etiqueta... diff --git a/src/Resources/Locales/fr_FR.axaml b/src/Resources/Locales/fr_FR.axaml index 39297041..32ae0e9f 100644 --- a/src/Resources/Locales/fr_FR.axaml +++ b/src/Resources/Locales/fr_FR.axaml @@ -190,7 +190,6 @@ Stash & Réappliquer Nom de la nouvelle branche : Entrez le nom de la branche. - Les espaces seront remplacés par des tirets. Créer une branche locale Créer un tag... Nouveau tag à : diff --git a/src/Resources/Locales/it_IT.axaml b/src/Resources/Locales/it_IT.axaml index dca05509..f437e6c6 100644 --- a/src/Resources/Locales/it_IT.axaml +++ b/src/Resources/Locales/it_IT.axaml @@ -267,7 +267,6 @@ Stasha e Ripristina Nome Nuovo Branch: Inserisci il nome del branch. - Gli spazi verranno rimpiazzati con dei trattini. Crea Branch Locale Sovrascrivi branch esistente Crea Tag... diff --git a/src/Resources/Locales/ja_JP.axaml b/src/Resources/Locales/ja_JP.axaml index 11221ef3..4698a550 100644 --- a/src/Resources/Locales/ja_JP.axaml +++ b/src/Resources/Locales/ja_JP.axaml @@ -189,7 +189,6 @@ スタッシュして再適用 新しいブランチの名前: ブランチの名前を入力 - スペースはダッシュに置き換えられます。 ローカルブランチを作成 タグを作成... 付与されるコミット: diff --git a/src/Resources/Locales/ru_RU.axaml b/src/Resources/Locales/ru_RU.axaml index 25427f44..0003e80d 100644 --- a/src/Resources/Locales/ru_RU.axaml +++ b/src/Resources/Locales/ru_RU.axaml @@ -267,7 +267,6 @@ Отложить и применить повторно Имя новой ветки: Введите имя ветки. - Пробелы будут заменены на тире. Создать локальную ветку Перезаписать существующую ветку Создать метку... diff --git a/src/Resources/Locales/ta_IN.axaml b/src/Resources/Locales/ta_IN.axaml index 74cd76d1..a29ccef3 100644 --- a/src/Resources/Locales/ta_IN.axaml +++ b/src/Resources/Locales/ta_IN.axaml @@ -189,7 +189,6 @@ பதுக்கிவை & மீண்டும் இடு புதிய கிளை பெயர்: கிளை பெயரை உள்ளிடவும். - இடைவெளிகள் கோடுகளால் மாற்றப்படும். உள்ளக கிளையை உருவாக்கு குறிச்சொல்லை உருவாக்கு... இங்கு புதிய குறிச்சொல்: diff --git a/src/Resources/Locales/uk_UA.axaml b/src/Resources/Locales/uk_UA.axaml index bc674137..82e2a0c6 100644 --- a/src/Resources/Locales/uk_UA.axaml +++ b/src/Resources/Locales/uk_UA.axaml @@ -194,7 +194,6 @@ Сховати та Застосувати Назва нової гілки: Введіть назву гілки. - Пробіли будуть замінені на тире. Створити локальну гілку Створити тег... Новий тег для: diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 59d06e3e..a1447d74 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -268,7 +268,6 @@ 贮藏并自动恢复 新分支名 : 填写分支名称。 - 空格将被替换为'-'符号 创建本地分支 允许重置已存在的分支 新建标签 ... diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 78539749..93e6c2e4 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -268,7 +268,6 @@ 擱置變更並自動復原 新分支名稱: 輸入分支名稱。 - 空格將以英文破折號取代 建立本機分支 允許覆寫現有分支 新增標籤... diff --git a/src/ViewModels/CreateBranch.cs b/src/ViewModels/CreateBranch.cs index b79b1785..9873c563 100644 --- a/src/ViewModels/CreateBranch.cs +++ b/src/ViewModels/CreateBranch.cs @@ -7,7 +7,7 @@ namespace SourceGit.ViewModels public class CreateBranch : Popup { [Required(ErrorMessage = "Branch name is required!")] - [RegularExpression(@"^[\w \-/\.#\+]+$", ErrorMessage = "Bad branch name format!")] + [RegularExpression(@"^[\w\-/\.#\+]+$", ErrorMessage = "Bad branch name format!")] [CustomValidation(typeof(CreateBranch), nameof(ValidateBranchName))] public string Name { @@ -101,10 +101,9 @@ namespace SourceGit.ViewModels { if (!creator._allowOverwrite) { - var fixedName = Models.Branch.FixName(name); foreach (var b in creator._repo.Branches) { - if (b.FriendlyName.Equals(fixedName, StringComparison.Ordinal)) + if (b.FriendlyName.Equals(name, StringComparison.Ordinal)) return new ValidationResult("A branch with same name already exists!"); } } @@ -119,8 +118,7 @@ namespace SourceGit.ViewModels { _repo.SetWatcherEnabled(false); - var fixedName = Models.Branch.FixName(_name); - var log = _repo.CreateLog($"Create Branch '{fixedName}'"); + var log = _repo.CreateLog($"Create Branch '{_name}'"); Use(log); if (CheckoutAfterCreated) @@ -166,7 +164,7 @@ namespace SourceGit.ViewModels succ = await new Commands.Checkout(_repo.FullPath) .Use(log) - .BranchAsync(fixedName, _baseOnRevision, DiscardLocalChanges, _allowOverwrite); + .BranchAsync(_name, _baseOnRevision, DiscardLocalChanges, _allowOverwrite); if (succ) { @@ -187,7 +185,7 @@ namespace SourceGit.ViewModels } else { - succ = await new Commands.Branch(_repo.FullPath, fixedName) + succ = await new Commands.Branch(_repo.FullPath, _name) .Use(log) .CreateAsync(_baseOnRevision, _allowOverwrite); } @@ -205,7 +203,7 @@ namespace SourceGit.ViewModels } if (autoSetUpstream) - await new Commands.Branch(_repo.FullPath, fixedName) + await new Commands.Branch(_repo.FullPath, _name) .Use(log) .SetUpstreamAsync(basedOn); } @@ -214,7 +212,7 @@ namespace SourceGit.ViewModels if (succ && CheckoutAfterCreated) { - var fake = new Models.Branch() { IsLocal = true, FullName = $"refs/heads/{fixedName}" }; + var fake = new Models.Branch() { IsLocal = true, FullName = $"refs/heads/{_name}" }; if (BasedOn is Models.Branch { IsLocal: false } based) fake.Upstream = based.FullName; diff --git a/src/ViewModels/RenameBranch.cs b/src/ViewModels/RenameBranch.cs index 807e3406..2a3d06cb 100644 --- a/src/ViewModels/RenameBranch.cs +++ b/src/ViewModels/RenameBranch.cs @@ -12,7 +12,7 @@ namespace SourceGit.ViewModels } [Required(ErrorMessage = "Branch name is required!!!")] - [RegularExpression(@"^[\w \-/\.#\+]+$", ErrorMessage = "Bad branch name format!")] + [RegularExpression(@"^[\w\-/\.#\+]+$", ErrorMessage = "Bad branch name format!")] [CustomValidation(typeof(RenameBranch), nameof(ValidateBranchName))] public string Name { @@ -31,10 +31,9 @@ namespace SourceGit.ViewModels { if (ctx.ObjectInstance is RenameBranch rename) { - var fixedName = Models.Branch.FixName(name); foreach (var b in rename._repo.Branches) { - if (b.IsLocal && b != rename.Target && b.Name.Equals(fixedName, StringComparison.Ordinal)) + if (b.IsLocal && b != rename.Target && b.Name.Equals(name, StringComparison.Ordinal)) return new ValidationResult("A branch with same name already exists!!!"); } } @@ -44,8 +43,7 @@ namespace SourceGit.ViewModels public override async Task Sure() { - var fixedName = Models.Branch.FixName(_name); - if (fixedName.Equals(Target.Name, StringComparison.Ordinal)) + if (Target.Name.Equals(_name, StringComparison.Ordinal)) return true; _repo.SetWatcherEnabled(false); @@ -59,7 +57,7 @@ namespace SourceGit.ViewModels var succ = await new Commands.Branch(_repo.FullPath, Target.Name) .Use(log) - .RenameAsync(fixedName); + .RenameAsync(_name); if (succ) { @@ -68,7 +66,7 @@ namespace SourceGit.ViewModels if (filter.Type == Models.FilterType.LocalBranch && filter.Pattern.Equals(oldName, StringComparison.Ordinal)) { - filter.Pattern = $"refs/heads/{fixedName}"; + filter.Pattern = $"refs/heads/{_name}"; break; } } diff --git a/src/Views/BranchOrTagNameTextBox.cs b/src/Views/BranchOrTagNameTextBox.cs new file mode 100644 index 00000000..8dbf37db --- /dev/null +++ b/src/Views/BranchOrTagNameTextBox.cs @@ -0,0 +1,63 @@ +using System; +using System.Text; + +using Avalonia.Controls; +using Avalonia.Input; +using Avalonia.Interactivity; + +namespace SourceGit.Views +{ + public class BranchOrTagNameTextBox : TextBox + { + protected override Type StyleKeyOverride => typeof(TextBox); + + protected override void OnLoaded(RoutedEventArgs e) + { + base.OnLoaded(e); + PastingFromClipboard += OnPastingFromClipboard; + } + + protected override void OnUnloaded(RoutedEventArgs e) + { + PastingFromClipboard -= OnPastingFromClipboard; + base.OnUnloaded(e); + } + + protected override void OnTextInput(TextInputEventArgs e) + { + if (string.IsNullOrEmpty(e.Text)) + return; + + var builder = new StringBuilder(e.Text.Length); + var chars = e.Text.ToCharArray(); + foreach (var ch in chars) + { + if (char.IsWhiteSpace(ch)) + builder.Append('-'); + else + builder.Append(ch); + } + + e.Text = builder.ToString(); + base.OnTextInput(e); + } + + private async void OnPastingFromClipboard(object sender, RoutedEventArgs e) + { + try + { + var clipboard = TopLevel.GetTopLevel(this)?.Clipboard; + if (clipboard != null) + { + var text = await clipboard.GetTextAsync(); + if (!string.IsNullOrEmpty(text)) + OnTextInput(new TextInputEventArgs() { Text = text }); + } + } + finally + { + e.Handled = true; + } + } + } +} diff --git a/src/Views/CreateBranch.axaml b/src/Views/CreateBranch.axaml index c52d8696..91df0014 100644 --- a/src/Views/CreateBranch.axaml +++ b/src/Views/CreateBranch.axaml @@ -13,7 +13,7 @@ - + - - - - - + - - + - - - diff --git a/src/Views/CreateTag.axaml b/src/Views/CreateTag.axaml index be16e754..a57a4e46 100644 --- a/src/Views/CreateTag.axaml +++ b/src/Views/CreateTag.axaml @@ -41,13 +41,13 @@ HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,8,0" Text="{DynamicResource Text.CreateTag.Name}"/> - + - + - - - - - - + From 2f61f06ca2532bdf2a494c978c25bd75c180300c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 25 Aug 2025 07:51:08 +0000 Subject: [PATCH 06/55] doc: Update translation status and sort locale files --- TRANSLATION.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/TRANSLATION.md b/TRANSLATION.md index 071076f6..e8198ec0 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -30,7 +30,7 @@ This document shows the translation status of each locale file in the repository
-### ![fr__FR](https://img.shields.io/badge/fr__FR-79.98%25-yellow) +### ![fr__FR](https://img.shields.io/badge/fr__FR-79.95%25-yellow)
Missing keys in fr_FR.axaml @@ -225,7 +225,7 @@ This document shows the translation status of each locale file in the repository
-### ![ja__JP](https://img.shields.io/badge/ja__JP-79.98%25-yellow) +### ![ja__JP](https://img.shields.io/badge/ja__JP-79.95%25-yellow)
Missing keys in ja_JP.axaml @@ -407,7 +407,7 @@ This document shows the translation status of each locale file in the repository
-### ![pt__BR](https://img.shields.io/badge/pt__BR-73.30%25-red) +### ![pt__BR](https://img.shields.io/badge/pt__BR-73.39%25-red)
Missing keys in pt_BR.axaml @@ -500,7 +500,6 @@ This document shows the translation status of each locale file in the repository - Text.ConfirmRestart.Title - Text.ConfirmRestart.Message - Text.CopyFullPath -- Text.CreateBranch.Name.WarnSpace - Text.CreateBranch.OverwriteExisting - Text.DeinitSubmodule - Text.DeinitSubmodule.Force @@ -656,7 +655,7 @@ This document shows the translation status of each locale file in the repository
-### ![ta__IN](https://img.shields.io/badge/ta__IN-80.09%25-yellow) +### ![ta__IN](https://img.shields.io/badge/ta__IN-80.07%25-yellow)
Missing keys in ta_IN.axaml @@ -837,7 +836,7 @@ This document shows the translation status of each locale file in the repository
-### ![uk__UA](https://img.shields.io/badge/uk__UA-81.24%25-yellow) +### ![uk__UA](https://img.shields.io/badge/uk__UA-81.22%25-yellow)
Missing keys in uk_UA.axaml From b00bf2a0ece04ca426d9e5c4e99332fc1e51463d Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 25 Aug 2025 17:18:21 +0800 Subject: [PATCH 07/55] feature: supports to read OpenAI API key from env (#1748) Signed-off-by: leo --- src/Models/OpenAI.cs | 10 +++++++++- src/Resources/Locales/en_US.axaml | 1 + src/Resources/Locales/zh_CN.axaml | 1 + src/Resources/Locales/zh_TW.axaml | 1 + src/Views/Preferences.axaml | 5 ++++- 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/Models/OpenAI.cs b/src/Models/OpenAI.cs index f8d76328..9380a855 100644 --- a/src/Models/OpenAI.cs +++ b/src/Models/OpenAI.cs @@ -117,6 +117,12 @@ namespace SourceGit.Models set => SetProperty(ref _apiKey, value); } + public bool ReadApiKeyFromEnv + { + get => _readApiKeyFromEnv; + set => SetProperty(ref _readApiKeyFromEnv, value); + } + public string Model { get => _model; @@ -176,8 +182,9 @@ namespace SourceGit.Models public async Task ChatAsync(string prompt, string question, CancellationToken cancellation, Action onUpdate) { + var finalKey = _readApiKeyFromEnv ? Environment.GetEnvironmentVariable(_apiKey) : _apiKey; var server = new Uri(_server); - var key = new ApiKeyCredential(_apiKey); + var key = new ApiKeyCredential(finalKey); var oaiClient = _server.Contains("openai.azure.com/", StringComparison.Ordinal) ? new AzureOpenAIClient(server, key) : new OpenAIClient(key, new() { Endpoint = server }); @@ -220,6 +227,7 @@ namespace SourceGit.Models private string _name; private string _server; private string _apiKey; + private bool _readApiKeyFromEnv = false; private string _model; private bool _streaming = true; private string _analyzeDiffPrompt; diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 6e16643f..be2fe1e6 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -530,6 +530,7 @@ Generate Subject Prompt Model Name + Entered value is the name to load API key from ENV Server Enable Streaming APPEARANCE diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index a1447d74..b6df5eef 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -534,6 +534,7 @@ Generate Subject Prompt 模型 配置名称 + 从环境变量(填写环境变量名)中读取API密钥 服务地址 启用流式输出 外观配置 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 93e6c2e4..5712a674 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -534,6 +534,7 @@ 產生提交訊息提示詞 模型 名稱 + 從環境變數中(輸入為環境變數名稱)載入金鑰 伺服器 啟用串流輸出 外觀設定 diff --git a/src/Views/Preferences.axaml b/src/Views/Preferences.axaml index 141262e4..d7f56ca1 100644 --- a/src/Views/Preferences.axaml +++ b/src/Views/Preferences.axaml @@ -788,7 +788,10 @@ - + + Date: Mon, 25 Aug 2025 09:19:02 +0000 Subject: [PATCH 08/55] doc: Update translation status and sort locale files --- TRANSLATION.md | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/TRANSLATION.md b/TRANSLATION.md index e8198ec0..1a5bc86f 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -6,31 +6,33 @@ This document shows the translation status of each locale file in the repository ### ![en_US](https://img.shields.io/badge/en__US-%E2%88%9A-brightgreen) -### ![de__DE](https://img.shields.io/badge/de__DE-99.54%25-yellow) +### ![de__DE](https://img.shields.io/badge/de__DE-99.42%25-yellow)
Missing keys in de_DE.axaml - Text.CommitMessageTextBox.PasteAndReplaceAll +- Text.Preferences.AI.ReadApiKeyFromEnv - Text.Preferences.General.ShowChangesPageByDefault - Text.WorkingCopy.ClearCommitHistories - Text.WorkingCopy.ClearCommitHistories.Confirm
-### ![es__ES](https://img.shields.io/badge/es__ES-99.54%25-yellow) +### ![es__ES](https://img.shields.io/badge/es__ES-99.42%25-yellow)
Missing keys in es_ES.axaml - Text.CommitMessageTextBox.PasteAndReplaceAll +- Text.Preferences.AI.ReadApiKeyFromEnv - Text.Preferences.General.ShowChangesPageByDefault - Text.WorkingCopy.ClearCommitHistories - Text.WorkingCopy.ClearCommitHistories.Confirm
-### ![fr__FR](https://img.shields.io/badge/fr__FR-79.95%25-yellow) +### ![fr__FR](https://img.shields.io/badge/fr__FR-79.86%25-yellow)
Missing keys in fr_FR.axaml @@ -134,6 +136,7 @@ This document shows the translation status of each locale file in the repository - Text.MoveSubmodule - Text.MoveSubmodule.MoveTo - Text.MoveSubmodule.Submodule +- Text.Preferences.AI.ReadApiKeyFromEnv - Text.Preferences.General.EnableCompactFolders - Text.Preferences.General.ShowChangesPageByDefault - Text.Preferences.Git.IgnoreCRAtEOLInDiff @@ -212,12 +215,13 @@ This document shows the translation status of each locale file in the repository
-### ![it__IT](https://img.shields.io/badge/it__IT-99.42%25-yellow) +### ![it__IT](https://img.shields.io/badge/it__IT-99.31%25-yellow)
Missing keys in it_IT.axaml - Text.CommitMessageTextBox.PasteAndReplaceAll +- Text.Preferences.AI.ReadApiKeyFromEnv - Text.Preferences.General.EnableCompactFolders - Text.Preferences.General.ShowChangesPageByDefault - Text.WorkingCopy.ClearCommitHistories @@ -225,7 +229,7 @@ This document shows the translation status of each locale file in the repository
-### ![ja__JP](https://img.shields.io/badge/ja__JP-79.95%25-yellow) +### ![ja__JP](https://img.shields.io/badge/ja__JP-79.86%25-yellow)
Missing keys in ja_JP.axaml @@ -330,6 +334,7 @@ This document shows the translation status of each locale file in the repository - Text.MoveSubmodule - Text.MoveSubmodule.MoveTo - Text.MoveSubmodule.Submodule +- Text.Preferences.AI.ReadApiKeyFromEnv - Text.Preferences.General.EnableCompactFolders - Text.Preferences.General.ShowChangesPageByDefault - Text.Preferences.Git.IgnoreCRAtEOLInDiff @@ -407,7 +412,7 @@ This document shows the translation status of each locale file in the repository
-### ![pt__BR](https://img.shields.io/badge/pt__BR-73.39%25-red) +### ![pt__BR](https://img.shields.io/badge/pt__BR-73.30%25-red)
Missing keys in pt_BR.axaml @@ -546,6 +551,7 @@ This document shows the translation status of each locale file in the repository - Text.MoveSubmodule - Text.MoveSubmodule.MoveTo - Text.MoveSubmodule.Submodule +- Text.Preferences.AI.ReadApiKeyFromEnv - Text.Preferences.AI.Streaming - Text.Preferences.Appearance.EditorTabWidth - Text.Preferences.General.DateFormat @@ -646,16 +652,17 @@ This document shows the translation status of each locale file in the repository
-### ![ru__RU](https://img.shields.io/badge/ru__RU-99.88%25-yellow) +### ![ru__RU](https://img.shields.io/badge/ru__RU-99.77%25-yellow)
Missing keys in ru_RU.axaml - Text.CommitMessageTextBox.PasteAndReplaceAll +- Text.Preferences.AI.ReadApiKeyFromEnv
-### ![ta__IN](https://img.shields.io/badge/ta__IN-80.07%25-yellow) +### ![ta__IN](https://img.shields.io/badge/ta__IN-79.98%25-yellow)
Missing keys in ta_IN.axaml @@ -760,6 +767,7 @@ This document shows the translation status of each locale file in the repository - Text.MoveSubmodule - Text.MoveSubmodule.MoveTo - Text.MoveSubmodule.Submodule +- Text.Preferences.AI.ReadApiKeyFromEnv - Text.Preferences.General.EnableCompactFolders - Text.Preferences.General.ShowChangesPageByDefault - Text.Preferences.Git.IgnoreCRAtEOLInDiff @@ -836,7 +844,7 @@ This document shows the translation status of each locale file in the repository
-### ![uk__UA](https://img.shields.io/badge/uk__UA-81.22%25-yellow) +### ![uk__UA](https://img.shields.io/badge/uk__UA-81.13%25-yellow)
Missing keys in uk_UA.axaml @@ -936,6 +944,7 @@ This document shows the translation status of each locale file in the repository - Text.MoveSubmodule - Text.MoveSubmodule.MoveTo - Text.MoveSubmodule.Submodule +- Text.Preferences.AI.ReadApiKeyFromEnv - Text.Preferences.General.EnableCompactFolders - Text.Preferences.General.ShowChangesPageByDefault - Text.Preferences.Git.IgnoreCRAtEOLInDiff From 1f4ec10e6a23ed73d2ff30dd43ffffa728e16f6b Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 25 Aug 2025 17:38:47 +0800 Subject: [PATCH 09/55] code_style: readability Signed-off-by: leo --- src/Models/OpenAI.cs | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/Models/OpenAI.cs b/src/Models/OpenAI.cs index 9380a855..c38eb674 100644 --- a/src/Models/OpenAI.cs +++ b/src/Models/OpenAI.cs @@ -182,16 +182,19 @@ namespace SourceGit.Models public async Task ChatAsync(string prompt, string question, CancellationToken cancellation, Action onUpdate) { - var finalKey = _readApiKeyFromEnv ? Environment.GetEnvironmentVariable(_apiKey) : _apiKey; - var server = new Uri(_server); - var key = new ApiKeyCredential(finalKey); - var oaiClient = _server.Contains("openai.azure.com/", StringComparison.Ordinal) - ? new AzureOpenAIClient(server, key) - : new OpenAIClient(key, new() { Endpoint = server }); - var client = oaiClient.GetChatClient(_model); - var messages = new List(); - messages.Add(_model.Equals("o1-mini", StringComparison.Ordinal) ? new UserChatMessage(prompt) : new SystemChatMessage(prompt)); - messages.Add(new UserChatMessage(question)); + var key = _readApiKeyFromEnv ? Environment.GetEnvironmentVariable(_apiKey) : _apiKey; + var endPoint = new Uri(_server); + var credential = new ApiKeyCredential(key); + var client = _server.Contains("openai.azure.com/", StringComparison.Ordinal) + ? new AzureOpenAIClient(endPoint, credential) + : new OpenAIClient(credential, new() { Endpoint = endPoint }); + + var chatClient = client.GetChatClient(_model); + var messages = new List() + { + _model.Equals("o1-mini", StringComparison.Ordinal) ? new UserChatMessage(prompt) : new SystemChatMessage(prompt), + new UserChatMessage(question), + }; try { @@ -199,7 +202,7 @@ namespace SourceGit.Models if (_streaming) { - var updates = client.CompleteChatStreamingAsync(messages, null, cancellation); + var updates = chatClient.CompleteChatStreamingAsync(messages, null, cancellation); await foreach (var update in updates) { @@ -209,7 +212,7 @@ namespace SourceGit.Models } else { - var completion = await client.CompleteChatAsync(messages, null, cancellation); + var completion = await chatClient.CompleteChatAsync(messages, null, cancellation); if (completion.Value.Content.Count > 0) rsp.Append(completion.Value.Content[0].Text); From d3b454174650ff99004132712d30ff1d3131e881 Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 26 Aug 2025 10:27:40 +0800 Subject: [PATCH 10/55] fix: binding diagnostics warnings Signed-off-by: leo --- src/ViewModels/CommitDetail.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/ViewModels/CommitDetail.cs b/src/ViewModels/CommitDetail.cs index 759b2741..90faf863 100644 --- a/src/ViewModels/CommitDetail.cs +++ b/src/ViewModels/CommitDetail.cs @@ -291,7 +291,7 @@ namespace SourceGit.ViewModels private void Refresh() { - _changes = null; + _changes = []; _requestingRevisionFiles = false; _revisionFiles = null; @@ -426,9 +426,6 @@ namespace SourceGit.ViewModels private void RefreshVisibleChanges() { - if (_changes == null) - return; - if (string.IsNullOrEmpty(_searchChangeFilter)) { VisibleChanges = _changes; @@ -578,8 +575,8 @@ namespace SourceGit.ViewModels private Models.CommitFullMessage _fullMessage = null; private Models.CommitSignInfo _signInfo = null; private List _children = null; - private List _changes = null; - private List _visibleChanges = null; + private List _changes = []; + private List _visibleChanges = []; private List _selectedChanges = null; private string _searchChangeFilter = string.Empty; private DiffContext _diffContext = null; From db9b13cbce1fc3134ee8441bcaf03e026d5c5a4f Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 26 Aug 2025 10:47:51 +0800 Subject: [PATCH 11/55] fix: sometimes group header disappeared Signed-off-by: leo --- src/Resources/Styles.axaml | 1 - src/Views/CommitBaseInfo.axaml | 4 ++-- src/Views/Repository.axaml | 40 +++++++++++++++++----------------- 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/src/Resources/Styles.axaml b/src/Resources/Styles.axaml index f127c9e2..565e1abf 100644 --- a/src/Resources/Styles.axaml +++ b/src/Resources/Styles.axaml @@ -306,7 +306,6 @@ diff --git a/src/ViewModels/Preferences.cs b/src/ViewModels/Preferences.cs index dde6ea5b..95347d6d 100644 --- a/src/ViewModels/Preferences.cs +++ b/src/ViewModels/Preferences.cs @@ -158,6 +158,12 @@ namespace SourceGit.ViewModels set => SetProperty(ref _useFixedTabWidth, value); } + public bool UseAutoHideScrollBars + { + get => _useAutoHideScrollBars; + set => SetProperty(ref _useAutoHideScrollBars, value); + } + public bool Check4UpdatesOnStartup { get => _check4UpdatesOnStartup; @@ -706,6 +712,7 @@ namespace SourceGit.ViewModels private int _maxHistoryCommits = 20000; private int _subjectGuideLength = 50; private bool _useFixedTabWidth = true; + private bool _useAutoHideScrollBars = true; private bool _showAuthorTimeInGraph = false; private bool _showChildren = false; diff --git a/src/Views/Preferences.axaml b/src/Views/Preferences.axaml index d7f56ca1..6a4076a8 100644 --- a/src/Views/Preferences.axaml +++ b/src/Views/Preferences.axaml @@ -169,7 +169,7 @@ - + + + Date: Wed, 27 Aug 2025 07:57:23 +0000 Subject: [PATCH 24/55] doc: Update translation status and sort locale files --- TRANSLATION.md | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/TRANSLATION.md b/TRANSLATION.md index fa3c1f13..dd3485d1 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -6,7 +6,7 @@ This document shows the translation status of each locale file in the repository ### ![en_US](https://img.shields.io/badge/en__US-%E2%88%9A-brightgreen) -### ![de__DE](https://img.shields.io/badge/de__DE-98.74%25-yellow) +### ![de__DE](https://img.shields.io/badge/de__DE-98.63%25-yellow)
Missing keys in de_DE.axaml @@ -17,6 +17,7 @@ This document shows the translation status of each locale file in the repository - Text.DirtyState.HasPendingPullOrPush - Text.DirtyState.UpToDate - Text.Preferences.AI.ReadApiKeyFromEnv +- Text.Preferences.Appearance.UseAutoHideScrollBars - Text.Preferences.General.ShowChangesPageByDefault - Text.WorkingCopy.ClearCommitHistories - Text.WorkingCopy.ClearCommitHistories.Confirm @@ -25,7 +26,7 @@ This document shows the translation status of each locale file in the repository
-### ![es__ES](https://img.shields.io/badge/es__ES-98.74%25-yellow) +### ![es__ES](https://img.shields.io/badge/es__ES-98.63%25-yellow)
Missing keys in es_ES.axaml @@ -36,6 +37,7 @@ This document shows the translation status of each locale file in the repository - Text.DirtyState.HasPendingPullOrPush - Text.DirtyState.UpToDate - Text.Preferences.AI.ReadApiKeyFromEnv +- Text.Preferences.Appearance.UseAutoHideScrollBars - Text.Preferences.General.ShowChangesPageByDefault - Text.WorkingCopy.ClearCommitHistories - Text.WorkingCopy.ClearCommitHistories.Confirm @@ -44,7 +46,7 @@ This document shows the translation status of each locale file in the repository
-### ![fr__FR](https://img.shields.io/badge/fr__FR-79.31%25-yellow) +### ![fr__FR](https://img.shields.io/badge/fr__FR-79.22%25-yellow)
Missing keys in fr_FR.axaml @@ -153,6 +155,7 @@ This document shows the translation status of each locale file in the repository - Text.MoveSubmodule.MoveTo - Text.MoveSubmodule.Submodule - Text.Preferences.AI.ReadApiKeyFromEnv +- Text.Preferences.Appearance.UseAutoHideScrollBars - Text.Preferences.General.EnableCompactFolders - Text.Preferences.General.ShowChangesPageByDefault - Text.Preferences.Git.IgnoreCRAtEOLInDiff @@ -233,7 +236,7 @@ This document shows the translation status of each locale file in the repository
-### ![it__IT](https://img.shields.io/badge/it__IT-98.63%25-yellow) +### ![it__IT](https://img.shields.io/badge/it__IT-98.52%25-yellow)
Missing keys in it_IT.axaml @@ -244,6 +247,7 @@ This document shows the translation status of each locale file in the repository - Text.DirtyState.HasPendingPullOrPush - Text.DirtyState.UpToDate - Text.Preferences.AI.ReadApiKeyFromEnv +- Text.Preferences.Appearance.UseAutoHideScrollBars - Text.Preferences.General.EnableCompactFolders - Text.Preferences.General.ShowChangesPageByDefault - Text.WorkingCopy.ClearCommitHistories @@ -253,7 +257,7 @@ This document shows the translation status of each locale file in the repository
-### ![ja__JP](https://img.shields.io/badge/ja__JP-79.31%25-yellow) +### ![ja__JP](https://img.shields.io/badge/ja__JP-79.22%25-yellow)
Missing keys in ja_JP.axaml @@ -363,6 +367,7 @@ This document shows the translation status of each locale file in the repository - Text.MoveSubmodule.MoveTo - Text.MoveSubmodule.Submodule - Text.Preferences.AI.ReadApiKeyFromEnv +- Text.Preferences.Appearance.UseAutoHideScrollBars - Text.Preferences.General.EnableCompactFolders - Text.Preferences.General.ShowChangesPageByDefault - Text.Preferences.Git.IgnoreCRAtEOLInDiff @@ -442,7 +447,7 @@ This document shows the translation status of each locale file in the repository
-### ![pt__BR](https://img.shields.io/badge/pt__BR-72.80%25-red) +### ![pt__BR](https://img.shields.io/badge/pt__BR-72.72%25-red)
Missing keys in pt_BR.axaml @@ -588,6 +593,7 @@ This document shows the translation status of each locale file in the repository - Text.Preferences.AI.ReadApiKeyFromEnv - Text.Preferences.AI.Streaming - Text.Preferences.Appearance.EditorTabWidth +- Text.Preferences.Appearance.UseAutoHideScrollBars - Text.Preferences.General.DateFormat - Text.Preferences.General.EnableCompactFolders - Text.Preferences.General.ShowChangesPageByDefault @@ -688,7 +694,7 @@ This document shows the translation status of each locale file in the repository
-### ![ru__RU](https://img.shields.io/badge/ru__RU-99.09%25-yellow) +### ![ru__RU](https://img.shields.io/badge/ru__RU-98.97%25-yellow)
Missing keys in ru_RU.axaml @@ -699,12 +705,13 @@ This document shows the translation status of each locale file in the repository - Text.DirtyState.HasPendingPullOrPush - Text.DirtyState.UpToDate - Text.Preferences.AI.ReadApiKeyFromEnv +- Text.Preferences.Appearance.UseAutoHideScrollBars - Text.WorkingCopy.NoVerify - Text.Worktree.Open
-### ![ta__IN](https://img.shields.io/badge/ta__IN-79.43%25-yellow) +### ![ta__IN](https://img.shields.io/badge/ta__IN-79.34%25-yellow)
Missing keys in ta_IN.axaml @@ -814,6 +821,7 @@ This document shows the translation status of each locale file in the repository - Text.MoveSubmodule.MoveTo - Text.MoveSubmodule.Submodule - Text.Preferences.AI.ReadApiKeyFromEnv +- Text.Preferences.Appearance.UseAutoHideScrollBars - Text.Preferences.General.EnableCompactFolders - Text.Preferences.General.ShowChangesPageByDefault - Text.Preferences.Git.IgnoreCRAtEOLInDiff @@ -892,7 +900,7 @@ This document shows the translation status of each locale file in the repository
-### ![uk__UA](https://img.shields.io/badge/uk__UA-80.57%25-yellow) +### ![uk__UA](https://img.shields.io/badge/uk__UA-80.48%25-yellow)
Missing keys in uk_UA.axaml @@ -997,6 +1005,7 @@ This document shows the translation status of each locale file in the repository - Text.MoveSubmodule.MoveTo - Text.MoveSubmodule.Submodule - Text.Preferences.AI.ReadApiKeyFromEnv +- Text.Preferences.Appearance.UseAutoHideScrollBars - Text.Preferences.General.EnableCompactFolders - Text.Preferences.General.ShowChangesPageByDefault - Text.Preferences.Git.IgnoreCRAtEOLInDiff From 352a28701beaeede5f493fc9545f3e3b30ce3cf6 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 27 Aug 2025 16:13:07 +0800 Subject: [PATCH 25/55] ux: new tooltip style for local branch Signed-off-by: leo --- src/Models/Branch.cs | 1 + src/Resources/Locales/en_US.axaml | 1 + src/Resources/Locales/zh_CN.axaml | 1 + src/Resources/Locales/zh_TW.axaml | 1 + src/Views/BranchTree.axaml | 43 ++++++++++++++++--------------- 5 files changed, 26 insertions(+), 21 deletions(-) diff --git a/src/Models/Branch.cs b/src/Models/Branch.cs index 7206b49d..ecb6d516 100644 --- a/src/Models/Branch.cs +++ b/src/Models/Branch.cs @@ -44,6 +44,7 @@ namespace SourceGit.Models public bool IsUpstreamGone { get; set; } public string WorktreePath { get; set; } + public bool HasWorktree => !IsCurrent && !string.IsNullOrEmpty(WorktreePath); public string FriendlyName => IsLocal ? Name : $"{Remote}/{Name}"; } } diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 5fce7e10..ef33fca2 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -77,6 +77,7 @@ REMOTE TRACKING URL + WORKTREE CANCEL Reset to Parent Revision Reset to This Revision diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index f2e4f264..50604801 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -81,6 +81,7 @@ 远程 上游分支 远程地址 + 工作树 取 消 重置文件到上一版本 重置文件到该版本 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index daffb8db..ceea0daf 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -81,6 +81,7 @@ 遠端 上游分支 遠端網址 + 工作區 取 消 重設檔案到上一版本 重設檔案為此版本 diff --git a/src/Views/BranchTree.axaml b/src/Views/BranchTree.axaml index d4127d51..d378ecda 100644 --- a/src/Views/BranchTree.axaml +++ b/src/Views/BranchTree.axaml @@ -44,36 +44,37 @@ - - - - - - - - - - - - - + + + - + + + + - - - - + + + From b47986d6d357ce092cc9611afabb47e32bf298f7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 27 Aug 2025 08:19:09 +0000 Subject: [PATCH 26/55] doc: Update translation status and sort locale files --- TRANSLATION.md | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/TRANSLATION.md b/TRANSLATION.md index dd3485d1..1dde8f0a 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -6,12 +6,13 @@ This document shows the translation status of each locale file in the repository ### ![en_US](https://img.shields.io/badge/en__US-%E2%88%9A-brightgreen) -### ![de__DE](https://img.shields.io/badge/de__DE-98.63%25-yellow) +### ![de__DE](https://img.shields.io/badge/de__DE-98.52%25-yellow)
Missing keys in de_DE.axaml - Text.BranchCM.SwitchToWorktree +- Text.BranchTree.Worktree - Text.CommitMessageTextBox.PasteAndReplaceAll - Text.DirtyState.HasLocalChanges - Text.DirtyState.HasPendingPullOrPush @@ -26,12 +27,13 @@ This document shows the translation status of each locale file in the repository
-### ![es__ES](https://img.shields.io/badge/es__ES-98.63%25-yellow) +### ![es__ES](https://img.shields.io/badge/es__ES-98.52%25-yellow)
Missing keys in es_ES.axaml - Text.BranchCM.SwitchToWorktree +- Text.BranchTree.Worktree - Text.CommitMessageTextBox.PasteAndReplaceAll - Text.DirtyState.HasLocalChanges - Text.DirtyState.HasPendingPullOrPush @@ -46,7 +48,7 @@ This document shows the translation status of each locale file in the repository
-### ![fr__FR](https://img.shields.io/badge/fr__FR-79.22%25-yellow) +### ![fr__FR](https://img.shields.io/badge/fr__FR-79.13%25-yellow)
Missing keys in fr_FR.axaml @@ -71,6 +73,7 @@ This document shows the translation status of each locale file in the repository - Text.BranchTree.Remote - Text.BranchTree.Tracking - Text.BranchTree.URL +- Text.BranchTree.Worktree - Text.ChangeSubmoduleUrl - Text.ChangeSubmoduleUrl.Submodule - Text.ChangeSubmoduleUrl.URL @@ -236,12 +239,13 @@ This document shows the translation status of each locale file in the repository
-### ![it__IT](https://img.shields.io/badge/it__IT-98.52%25-yellow) +### ![it__IT](https://img.shields.io/badge/it__IT-98.40%25-yellow)
Missing keys in it_IT.axaml - Text.BranchCM.SwitchToWorktree +- Text.BranchTree.Worktree - Text.CommitMessageTextBox.PasteAndReplaceAll - Text.DirtyState.HasLocalChanges - Text.DirtyState.HasPendingPullOrPush @@ -257,7 +261,7 @@ This document shows the translation status of each locale file in the repository
-### ![ja__JP](https://img.shields.io/badge/ja__JP-79.22%25-yellow) +### ![ja__JP](https://img.shields.io/badge/ja__JP-79.13%25-yellow)
Missing keys in ja_JP.axaml @@ -283,6 +287,7 @@ This document shows the translation status of each locale file in the repository - Text.BranchTree.Remote - Text.BranchTree.Tracking - Text.BranchTree.URL +- Text.BranchTree.Worktree - Text.ChangeSubmoduleUrl - Text.ChangeSubmoduleUrl.Submodule - Text.ChangeSubmoduleUrl.URL @@ -447,7 +452,7 @@ This document shows the translation status of each locale file in the repository
-### ![pt__BR](https://img.shields.io/badge/pt__BR-72.72%25-red) +### ![pt__BR](https://img.shields.io/badge/pt__BR-72.63%25-red)
Missing keys in pt_BR.axaml @@ -480,6 +485,7 @@ This document shows the translation status of each locale file in the repository - Text.BranchTree.Remote - Text.BranchTree.Tracking - Text.BranchTree.URL +- Text.BranchTree.Worktree - Text.ChangeSubmoduleUrl - Text.ChangeSubmoduleUrl.Submodule - Text.ChangeSubmoduleUrl.URL @@ -694,12 +700,13 @@ This document shows the translation status of each locale file in the repository
-### ![ru__RU](https://img.shields.io/badge/ru__RU-98.97%25-yellow) +### ![ru__RU](https://img.shields.io/badge/ru__RU-98.86%25-yellow)
Missing keys in ru_RU.axaml - Text.BranchCM.SwitchToWorktree +- Text.BranchTree.Worktree - Text.CommitMessageTextBox.PasteAndReplaceAll - Text.DirtyState.HasLocalChanges - Text.DirtyState.HasPendingPullOrPush @@ -711,7 +718,7 @@ This document shows the translation status of each locale file in the repository
-### ![ta__IN](https://img.shields.io/badge/ta__IN-79.34%25-yellow) +### ![ta__IN](https://img.shields.io/badge/ta__IN-79.25%25-yellow)
Missing keys in ta_IN.axaml @@ -737,6 +744,7 @@ This document shows the translation status of each locale file in the repository - Text.BranchTree.Remote - Text.BranchTree.Tracking - Text.BranchTree.URL +- Text.BranchTree.Worktree - Text.ChangeSubmoduleUrl - Text.ChangeSubmoduleUrl.Submodule - Text.ChangeSubmoduleUrl.URL @@ -900,7 +908,7 @@ This document shows the translation status of each locale file in the repository
-### ![uk__UA](https://img.shields.io/badge/uk__UA-80.48%25-yellow) +### ![uk__UA](https://img.shields.io/badge/uk__UA-80.39%25-yellow)
Missing keys in uk_UA.axaml @@ -925,6 +933,7 @@ This document shows the translation status of each locale file in the repository - Text.BranchTree.Remote - Text.BranchTree.Tracking - Text.BranchTree.URL +- Text.BranchTree.Worktree - Text.ChangeSubmoduleUrl - Text.ChangeSubmoduleUrl.Submodule - Text.ChangeSubmoduleUrl.URL From bb52b0d06ba04f0daf84e03c5cb3cfae0220bf63 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 27 Aug 2025 17:08:36 +0800 Subject: [PATCH 27/55] feature: allow to scroll text diff view to clicked position in minimap bar (#1679) Signed-off-by: leo --- src/Views/TextDiffView.axaml | 2 +- src/Views/TextDiffView.axaml.cs | 44 +++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/src/Views/TextDiffView.axaml b/src/Views/TextDiffView.axaml index d7a9e43e..5717a8be 100644 --- a/src/Views/TextDiffView.axaml +++ b/src/Views/TextDiffView.axaml @@ -12,7 +12,7 @@ - + = startY && pressedY <= endY) + return; + + var line = Math.Max(1, Math.Min(total, (int)Math.Ceiling(pressedY * total / height))); + this.FindAncestorOfType()?.ScrollToLine(line); + e.Handled = true; + } + private void RenderSingleSide(DrawingContext context, List lines, double x, double width) { var total = lines.Count; @@ -1414,11 +1452,17 @@ namespace SourceGit.Views get => GetValue(SelectedChunkProperty); set => SetValue(SelectedChunkProperty, value); } + public TextDiffView() { InitializeComponent(); } + public void ScrollToLine(int line) + { + this.FindDescendantOfType()?.ScrollToLine(line); + } + protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change) { base.OnPropertyChanged(change); From ee657f5d5c50985353305bb8c2a4fcae4295faad Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 27 Aug 2025 17:57:31 +0800 Subject: [PATCH 28/55] enhance: use `Parent` instead of find `TextDiffView` first before find first `ThemedTextDiffPresenter` Signed-off-by: leo --- src/Views/TextDiffView.axaml.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Views/TextDiffView.axaml.cs b/src/Views/TextDiffView.axaml.cs index 85e8ebc9..784f7b40 100644 --- a/src/Views/TextDiffView.axaml.cs +++ b/src/Views/TextDiffView.axaml.cs @@ -11,6 +11,7 @@ using Avalonia.Controls; using Avalonia.Data; using Avalonia.Input; using Avalonia.Interactivity; +using Avalonia.LogicalTree; using Avalonia.Media; using Avalonia.Threading; using Avalonia.VisualTree; @@ -1405,7 +1406,9 @@ namespace SourceGit.Views return; var line = Math.Max(1, Math.Min(total, (int)Math.Ceiling(pressedY * total / height))); - this.FindAncestorOfType()?.ScrollToLine(line); + if (this.Parent is Control parent) + parent.FindLogicalDescendantOfType()?.ScrollToLine(line); + e.Handled = true; } @@ -1458,11 +1461,6 @@ namespace SourceGit.Views InitializeComponent(); } - public void ScrollToLine(int line) - { - this.FindDescendantOfType()?.ScrollToLine(line); - } - protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change) { base.OnPropertyChanged(change); From 786ca316f553ebaf2c61b35d30723f8a06e9b42c Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 27 Aug 2025 20:58:27 +0800 Subject: [PATCH 29/55] fix: wrong flags to query commits for interactive-rebase (#1765) Signed-off-by: leo --- src/Commands/QueryCommitsForInteractiveRebase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Commands/QueryCommitsForInteractiveRebase.cs b/src/Commands/QueryCommitsForInteractiveRebase.cs index 81e28d4f..fc9dda04 100644 --- a/src/Commands/QueryCommitsForInteractiveRebase.cs +++ b/src/Commands/QueryCommitsForInteractiveRebase.cs @@ -12,7 +12,7 @@ namespace SourceGit.Commands WorkingDirectory = repo; Context = repo; - Args = $"log --date-order --no-show-signature --decorate=full --format=\"%H%n%P%n%D%n%aN±%aE%n%at%n%cN±%cE%n%ct%n%B%n{_boundary}\" {on}..HEAD"; + Args = $"log --topo-order --right-only --max-parents=1 --no-show-signature --decorate=full --format=\"%H%n%P%n%D%n%aN±%aE%n%at%n%cN±%cE%n%ct%n%B%n{_boundary}\" {on}..HEAD"; } public async Task> GetResultAsync() From 0a397c4ebca022faed71d35f11eadf92fe56b747 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 28 Aug 2025 11:33:22 +0800 Subject: [PATCH 30/55] ux: always show tab selector button and use single-clicking instead of double-clicking to select item in list (#1711) Signed-off-by: leo --- src/Resources/Icons.axaml | 4 +- src/Resources/Locales/en_US.axaml | 2 +- src/ViewModels/LauncherPageSwitcher.cs | 1 + src/Views/Launcher.axaml | 28 ++++-- src/Views/Launcher.axaml.cs | 2 + src/Views/LauncherPageSwitcher.axaml | 2 +- src/Views/LauncherPageSwitcher.axaml.cs | 2 +- src/Views/LauncherTabBar.axaml | 107 ---------------------- src/Views/LauncherTabBar.axaml.cs | 114 ------------------------ src/Views/WorkspaceSwitcher.axaml | 2 +- src/Views/WorkspaceSwitcher.axaml.cs | 2 +- 11 files changed, 32 insertions(+), 234 deletions(-) diff --git a/src/Resources/Icons.axaml b/src/Resources/Icons.axaml index a8eec1db..fd7c9b8b 100644 --- a/src/Resources/Icons.axaml +++ b/src/Resources/Icons.axaml @@ -14,7 +14,6 @@ M512 32C246 32 32 250 32 512s218 480 480 480 480-218 480-480S774 32 512 32zm269 381L496 698c-26 26-61 26-83 0L243 528c-26-26-26-61 0-83s61-26 83 0l128 128 240-240c26-26 61-26 83 0 26 19 26 54 3 80z M747 467c29 0 56 4 82 12v-363c0-47-38-84-84-84H125c-47 0-84 38-84 84v707c0 47 38 84 84 84h375a287 287 0 01-43-152c0-160 129-289 289-289zm-531-250h438c19 0 34 15 34 34s-15 34-34 34H216c-19 0-34-15-34-34s15-34 34-34zm0 179h263c19 0 34 15 34 34s-15 34-34 34H216c-19 0-34-15-34-34s15-34 34-34zm131 247h-131c-19 0-34-15-34-34s15-34 34-34h131c19 0 34 15 34 34s-15 34-34 34zM747 521c-130 0-236 106-236 236S617 992 747 992s236-106 236-236S877 521 747 521zm11 386v-65h-130c-12 0-22-10-22-22s10-22 22-22h260l-130 108zm108-192H606l130-108v65h130c12 0 22 10 22 22s-10 22-22 22z M529 511c115 0 212 79 239 185h224a62 62 0 017 123l-7 0-224 0a247 247 0 01-479 0H65a62 62 0 01-7-123l7-0h224a247 247 0 01239-185zm0 124a124 124 0 100 247 124 124 0 000-247zm0-618c32 0 58 24 61 55l0 7V206c89 11 165 45 225 103a74 74 0 0122 45l0 9v87a62 62 0 01-123 7l-0-7v-65l-6-4c-43-33-97-51-163-53l-17-0c-74 0-133 18-180 54l-6 4v65a62 62 0 01-55 61l-7 0a62 62 0 01-61-55l-0-7V362c0-20 8-39 23-53 60-58 135-92 224-103V79c0-34 28-62 62-62z - M512 926c-229 0-414-186-414-414S283 98 512 98s414 186 414 414-186 414-414 414zm0-73c189 0 341-153 341-341S701 171 512 171 171 323 171 512s153 341 341 341zm-6-192L284 439l52-52 171 171 171-171L728 439l-222 222z M512 57c251 0 455 204 455 455S763 967 512 967 57 763 57 512 261 57 512 57zm181 274c-11-11-29-11-40 0L512 472 371 331c-11-11-29-11-40 0-11 11-11 29 0 40L471 512 331 653c-11 11-11 29 0 40 11 11 29 11 40 0l141-141 141 141c11 11 29 11 40 0 11-11 11-29 0-40L552 512l141-141c11-11 11-29 0-40z M591 907A85 85 0 01427 875h114a299 299 0 0050 32zM725 405c130 0 235 105 235 235s-105 235-235 235-235-105-235-235 105-235 235-235zM512 64a43 43 0 0143 43v24c126 17 229 107 264 225A298 298 0 00725 341l-4 0A235 235 0 00512 213l-5 0c-125 4-224 104-228 229l-0 6v167a211 211 0 01-26 101l-4 7-14 23h211a298 298 0 0050 85l-276-0a77 77 0 01-66-39c-13-22-14-50-2-73l2-4 22-36c10-17 16-37 17-57l0-7v-167C193 287 313 153 469 131V107a43 43 0 0139-43zm345 505L654 771a149 149 0 00202-202zM725 491a149 149 0 00-131 220l202-202A149 149 0 00725 491z M797 829a49 49 0 1049 49 49 49 0 00-49-49zm147-114A49 49 0 10992 764a49 49 0 00-49-49zM928 861a49 49 0 1049 49A49 49 0 00928 861zm-5-586L992 205 851 64l-71 71a67 67 0 00-94 0l235 235a67 67 0 000-94zm-853 128a32 32 0 00-32 50 1291 1291 0 0075 112L288 552c20 0 25 21 8 37l-93 86a1282 1282 0 00120 114l100-32c19-6 28 15 14 34l-40 55c26 19 53 36 82 53a89 89 0 00115-20 1391 1391 0 00256-485l-188-188s-306 224-595 198z @@ -125,6 +124,7 @@ M416 587c21 0 37 17 37 37v299A37 37 0 01416 960h-299a37 37 0 01-37-37v-299c0-21 17-37 37-37h299zm448 0c21 0 37 17 37 37v299A37 37 0 01864 960h-299a37 37 0 01-37-37v-299c0-21 17-37 37-37h299zM758 91l183 189a37 37 0 010 52l-182 188a37 37 0 01-53 1l-183-189a37 37 0 010-52l182-188a37 37 0 0153-1zM416 139c21 0 37 17 37 37v299A37 37 0 01416 512h-299a37 37 0 01-37-37v-299c0-21 17-37 37-37h299z M512 0C230 0 0 230 0 512c0 145 60 282 166 375L90 1024H512c282 0 512-230 512-512S794 0 512 0z M875 128h-725A107 107 0 0043 235v555A107 107 0 00149 896h725a107 107 0 00107-107v-555A107 107 0 00875 128zm-115 640h-183v-58l25-3c15 0 19-8 14-24l-22-61H419l-28 82 39 2V768h-166v-58l18-3c18-2 22-11 26-24l125-363-40-4V256h168l160 448 39 3zM506 340l-72 218h145l-71-218h-2z + M1097 372h-460l-146-299H146a73 73 0 00-73 73v731a73 73 0 0073 73h878a73 73 0 0073-73V372zM146 0h390l146 299h488V878a146 146 0 01-146 146H146a146 146 0 01-146-146V146a146 146 0 01146-146zm439 0h195l146 246h-195l-146-246zm244 0h195a146 146 0 01146 146v100h-195l-146-246z M177 156c-22 5-33 17-36 37c-10 57-33 258-13 278l445 445c23 23 61 23 84 0l246-246c23-23 23-61 0-84l-445-445C437 120 231 145 177 156zM331 344c-26 26-69 26-95 0c-26-26-26-69 0-95s69-26 95 0C357 276 357 318 331 344z M683 537h-144v-142h-142V283H239a44 44 0 00-41 41v171a56 56 0 0014 34l321 321a41 41 0 0058 0l174-174a41 41 0 000-58zm-341-109a41 41 0 110-58a41 41 0 010 58zM649 284V142h-69v142h-142v68h142v142h69v-142h142v-68h-142z M996 452 572 28A96 96 0 00504 0H96C43 0 0 43 0 96v408a96 96 0 0028 68l424 424c37 37 98 37 136 0l408-408c37-37 37-98 0-136zM224 320c-53 0-96-43-96-96s43-96 96-96 96 43 96 96-43 96-96 96zm1028 268L844 996c-37 37-98 37-136 0l-1-1L1055 647c34-34 53-79 53-127s-19-93-53-127L663 0h97a96 96 0 0168 28l424 424c37 37 37 98 0 136z @@ -147,7 +147,7 @@ M153 154h768v768h-768v-768zm64 64v640h640v-640h-640z M796 231v727H64V231h732zm-82 78H146V880h567V309zM229 66H960v732H796v-82h82V148h-567v82h-82V66z M248 221a77 77 0 00-30-21c-18-7-40-10-68-5a224 224 0 00-45 13c-5 2-10 5-15 8l-3 2v68l11-9c10-8 21-14 34-19 13-5 26-7 39-7 12 0 21 3 28 10 6 6 9 16 9 29l-62 9c-14 2-26 6-36 11a80 80 0 00-25 20c-7 8-12 17-15 27-6 21-6 44 1 65a70 70 0 0041 43c10 4 21 6 34 6a80 80 0 0063-28v22h64V298c0-16-2-31-6-44a91 91 0 00-18-33zm-41 121v15c0 8-1 15-4 22a48 48 0 01-24 29 44 44 0 01-33 2 29 29 0 01-10-6 25 25 0 01-6-9 30 30 0 01-2-12c0-5 1-9 2-14a21 21 0 015-9 28 28 0 0110-7 83 83 0 0120-5l42-6zm323-68a144 144 0 00-16-42 87 87 0 00-28-29 75 75 0 00-41-11 73 73 0 00-44 14c-6 5-12 11-17 17V64H326v398h59v-18c8 10 18 17 30 21 6 2 13 3 21 3 16 0 31-4 43-11 12-7 23-18 31-31a147 147 0 0019-46 248 248 0 006-57c0-17-2-33-5-49zm-55 49c0 15-1 28-4 39-2 11-6 20-10 27a41 41 0 01-15 15 37 37 0 01-36 1 44 44 0 01-13-12 59 59 0 01-9-18A76 76 0 01384 352v-33c0-10 1-20 4-29 2-8 6-15 10-22a43 43 0 0115-13 37 37 0 0119-5 35 35 0 0132 18c4 6 7 14 9 23 2 9 3 20 3 31zM154 634a58 58 0 0120-15c14-6 35-7 49-1 7 3 13 6 20 12l21 17V572l-6-4a124 124 0 00-58-14c-20 0-38 4-54 11-16 7-30 17-41 30-12 13-20 29-26 46-6 17-9 36-9 57 0 18 3 36 8 52 6 16 14 30 24 42 10 12 23 21 38 28 15 7 32 10 50 10 15 0 28-2 39-5 11-3 21-8 30-14l5-4v-57l-13 6a26 26 0 01-5 2c-3 1-6 2-8 3-2 1-15 6-15 6-4 2-9 3-14 4a63 63 0 01-38-4 53 53 0 01-20-14 70 70 0 01-13-24 111 111 0 01-5-34c0-13 2-26 5-36 3-10 8-19 14-26zM896 384h-256V320h288c21 1 32 12 32 32v384c0 18-12 32-32 32H504l132 133-45 45-185-185c-16-21-16-25 0-45l185-185L637 576l-128 128H896V384z - M128 691H6V38h838v160h-64V102H70v525H128zM973 806H154V250h819v557zm-755-64h691V314H218v429zM365 877h448v64h-448z + M0 512M1024 512M512 0M512 1024M128 691H6V38h838v160h-64V102H70v525H128zM973 806H154V250h819v557zm-755-64h691V314H218v429zM365 877h448v64h-448z M853 267H514c-4 0-6-2-9-4l-38-66c-13-21-38-36-64-36H171c-41 0-75 34-75 75v555c0 41 34 75 75 75h683c41 0 75-34 75-75V341c0-41-34-75-75-75zm-683-43h233c4 0 6 2 9 4l38 66c13 21 38 36 64 36H853c6 0 11 4 11 11v75h-704V235c0-6 4-11 11-11zm683 576H171c-6 0-11-4-11-11V480h704V789c0 6-4 11-11 11z M896 96 614 96c-58 0-128-19-179-51C422 38 390 19 358 19L262 19 128 19c-70 0-128 58-128 128l0 736c0 70 58 128 128 128l768 0c70 0 128-58 128-128L1024 224C1024 154 966 96 896 96zM704 685 544 685l0 160c0 19-13 32-32 32s-32-13-32-32l0-160L320 685c-19 0-32-13-32-32 0-19 13-32 32-32l160 0L480 461c0-19 13-32 32-32s32 13 32 32l0 160L704 621c19 0 32 13 32 32C736 666 723 685 704 685zM890 326 102 326 102 250c0-32 32-64 64-64l659 0c38 0 64 32 64 64L890 326z M1182 527a91 91 0 00-88-117H92a91 91 0 00-88 117l137 441A80 80 0 00217 1024h752a80 80 0 0076-56zM133 295a31 31 0 0031 31h858a31 31 0 0031-31A93 93 0 00959 203H226a93 93 0 00-94 92zM359 123h467a31 31 0 0031-31A92 92 0 00765 0H421a92 92 0 00-92 92 31 31 0 0031 31z diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index ef33fca2..8832a6b5 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -488,8 +488,8 @@ Open in Browser ERROR NOTICE - Workspaces Tabs + Workspaces Merge Branch Customize merge message Into: diff --git a/src/ViewModels/LauncherPageSwitcher.cs b/src/ViewModels/LauncherPageSwitcher.cs index 5f53021d..b732ca0e 100644 --- a/src/ViewModels/LauncherPageSwitcher.cs +++ b/src/ViewModels/LauncherPageSwitcher.cs @@ -32,6 +32,7 @@ namespace SourceGit.ViewModels { _launcher = launcher; UpdateVisiblePages(); + SelectedPage = launcher.ActivePage; } public void ClearFilter() diff --git a/src/Views/Launcher.axaml b/src/Views/Launcher.axaml index 1e5fcfdc..76f3073d 100644 --- a/src/Views/Launcher.axaml +++ b/src/Views/Launcher.axaml @@ -19,9 +19,9 @@ - + - - + + + - + - + diff --git a/src/Views/Launcher.axaml.cs b/src/Views/Launcher.axaml.cs index 2f2f8bee..dcf4533c 100644 --- a/src/Views/Launcher.axaml.cs +++ b/src/Views/Launcher.axaml.cs @@ -317,6 +317,8 @@ namespace SourceGit.Views { var pref = ViewModels.Preferences.Instance; var menu = new ContextMenu(); + menu.Placement = PlacementMode.BottomEdgeAlignedLeft; + menu.VerticalOffset = -6; for (var i = 0; i < pref.Workspaces.Count; i++) { diff --git a/src/Views/LauncherPageSwitcher.axaml b/src/Views/LauncherPageSwitcher.axaml index b52feef0..3f3eab24 100644 --- a/src/Views/LauncherPageSwitcher.axaml +++ b/src/Views/LauncherPageSwitcher.axaml @@ -83,7 +83,7 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -