diff --git a/src/Resources/Locales/ca_ES.axaml b/src/Resources/Locales/ca_ES.axaml
index a37a7709d..d8b98b302 100644
--- a/src/Resources/Locales/ca_ES.axaml
+++ b/src/Resources/Locales/ca_ES.axaml
@@ -21,6 +21,7 @@
REGENERA
Utilitza la IA per generar un missatge de comissió
Utilitza
+ Aplica i fes el «commit»
Amaga SourceGit
Amaga els altres
Mostra-ho tot
diff --git a/src/Resources/Locales/de_DE.axaml b/src/Resources/Locales/de_DE.axaml
index 9c59fd3de..e909881e1 100644
--- a/src/Resources/Locales/de_DE.axaml
+++ b/src/Resources/Locales/de_DE.axaml
@@ -21,6 +21,7 @@
NEU GENERIEREN
Verwende AI, um Commit-Nachrichten zu generieren
Übernehmen
+ Übernehmen und committen
SourceGit minimieren
Andere ausblenden
Alles anzeigen
diff --git a/src/Resources/Locales/el_GR.axaml b/src/Resources/Locales/el_GR.axaml
index 22cb8b4c7..8cb4aa02a 100644
--- a/src/Resources/Locales/el_GR.axaml
+++ b/src/Resources/Locales/el_GR.axaml
@@ -21,6 +21,7 @@
ΕΠΑΝΑΔΗΜΙΟΥΡΓΙΑ
Χρήση AI για δημιουργία μηνύματος commit
Χρήση
+ Εφαρμογή και καταχώρηση
Απόκρυψη SourceGit
Απόκρυψη άλλων
Εμφάνιση όλων
diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml
index eb625419d..0bbf0438f 100644
--- a/src/Resources/Locales/en_US.axaml
+++ b/src/Resources/Locales/en_US.axaml
@@ -17,6 +17,7 @@
RE-GENERATE
Use AI to generate commit message
Use
+ Apply and commit
Hide SourceGit
Hide Others
Show All
diff --git a/src/Resources/Locales/es_ES.axaml b/src/Resources/Locales/es_ES.axaml
index 37acc1527..91c20f04c 100644
--- a/src/Resources/Locales/es_ES.axaml
+++ b/src/Resources/Locales/es_ES.axaml
@@ -21,6 +21,7 @@
RE-GENERAR
Usar OpenAI para generar mensaje de commit
Usar
+ Aplicar y hacer commit
Ocultar SourceGit
Ocultar Otros
Mostrar Todo
diff --git a/src/Resources/Locales/fr_FR.axaml b/src/Resources/Locales/fr_FR.axaml
index 6b7bacef1..e7eb13bf3 100644
--- a/src/Resources/Locales/fr_FR.axaml
+++ b/src/Resources/Locales/fr_FR.axaml
@@ -21,6 +21,7 @@
RE-GÉNÉRER
Utiliser l'IA pour générer un message de commit
Utiliser
+ Appliquer et créer le commit
Masquer SourceGit
Masquer les autres
Tout Afficher
diff --git a/src/Resources/Locales/he_IL.axaml b/src/Resources/Locales/he_IL.axaml
index 153f55ef7..8bd2e85f7 100644
--- a/src/Resources/Locales/he_IL.axaml
+++ b/src/Resources/Locales/he_IL.axaml
@@ -21,6 +21,7 @@
צור מחדש
שימוש ב־AI ליצירת הודעת commit
שימוש
+ החלה וביצוע קומיט
הסתר SourceGit
הסתר אחרים
הצג הכול
diff --git a/src/Resources/Locales/id_ID.axaml b/src/Resources/Locales/id_ID.axaml
index d8eda31ee..7076b5c78 100644
--- a/src/Resources/Locales/id_ID.axaml
+++ b/src/Resources/Locales/id_ID.axaml
@@ -21,6 +21,7 @@
BUAT ULANG
Gunakan AI untuk membuat pesan commit
Gunakan
+ Terapkan dan buat komit
Sembunyikan SourceGit
Sembunyikan Lainnya
Tampilkan Semua
diff --git a/src/Resources/Locales/it_IT.axaml b/src/Resources/Locales/it_IT.axaml
index eee191ced..38a72a300 100644
--- a/src/Resources/Locales/it_IT.axaml
+++ b/src/Resources/Locales/it_IT.axaml
@@ -20,6 +20,7 @@
Modello
RIGENERA
Usa AI per generare il messaggio di commit
+ Applica e crea il commit
Nascondi SourceGit
Mostra Tutto
Seleziona file patch da applicare
diff --git a/src/Resources/Locales/ja_JP.axaml b/src/Resources/Locales/ja_JP.axaml
index fdef11c27..529a0154e 100644
--- a/src/Resources/Locales/ja_JP.axaml
+++ b/src/Resources/Locales/ja_JP.axaml
@@ -21,6 +21,7 @@
再生成
AI を使用してコミットメッセージを生成
使用
+ 適用してコミット
SourceGit を隠す
他を隠す
すべて表示
diff --git a/src/Resources/Locales/ko_KR.axaml b/src/Resources/Locales/ko_KR.axaml
index e3dda7a43..c0d1fee37 100644
--- a/src/Resources/Locales/ko_KR.axaml
+++ b/src/Resources/Locales/ko_KR.axaml
@@ -21,6 +21,7 @@
재생성
AI를 사용하여 커밋 메시지 생성
사용
+ 적용 후 커밋
SourceGit 숨기기
다른 항목 숨기기
모두 보기
diff --git a/src/Resources/Locales/pt_BR.axaml b/src/Resources/Locales/pt_BR.axaml
index 5084f0180..a21fa9222 100644
--- a/src/Resources/Locales/pt_BR.axaml
+++ b/src/Resources/Locales/pt_BR.axaml
@@ -20,6 +20,7 @@
Modelo
Gerar novamente
Utilizar IA para gerar mensagem de commit
+ Aplicar e criar commit
Esconder SourceGit
Mostrar Todos
Selecione o arquivo patch para aplicar
diff --git a/src/Resources/Locales/ru_RU.axaml b/src/Resources/Locales/ru_RU.axaml
index 419d615e4..339ac9691 100644
--- a/src/Resources/Locales/ru_RU.axaml
+++ b/src/Resources/Locales/ru_RU.axaml
@@ -21,6 +21,7 @@
ПЕРЕСОЗДАТЬ
Использовать OpenAI для создания сообщения о ревизии
Использовать
+ Применить и создать коммит
Скрыть SourceGit
Скрыть остальные
Показать все
diff --git a/src/Resources/Locales/ta_IN.axaml b/src/Resources/Locales/ta_IN.axaml
index 3473ff1ca..4bc9064d3 100644
--- a/src/Resources/Locales/ta_IN.axaml
+++ b/src/Resources/Locales/ta_IN.axaml
@@ -15,6 +15,7 @@
மாதிரி
மறு-உருவாக்கு
உறுதிமொழி செய்தியை உருவாக்க செநுவைப் பயன்படுத்து
+ பயன்படுத்து, உறுதிசெய்
.ஒட்டு இடுவதற்கு கோப்பைத் தேர்ந்தெடு
வெள்ளைவெளி மாற்றங்களைப் புறக்கணி
ஒட்டு இடு
diff --git a/src/Resources/Locales/uk_UA.axaml b/src/Resources/Locales/uk_UA.axaml
index 5f44193e3..302d8cbc1 100644
--- a/src/Resources/Locales/uk_UA.axaml
+++ b/src/Resources/Locales/uk_UA.axaml
@@ -15,6 +15,7 @@
Модель
ПЕРЕГЕНЕРУВАТИ
Використати AI для генерації повідомлення коміту
+ Застосувати й створити коміт
Виберіть файл .patch для застосування
Ігнорувати зміни пробілів
Застосувати Патч
diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml
index e2448c8c1..63fdcc7c4 100644
--- a/src/Resources/Locales/zh_CN.axaml
+++ b/src/Resources/Locales/zh_CN.axaml
@@ -21,6 +21,7 @@
重新生成
使用AI助手生成提交信息
应用
+ 应用并提交
隐藏 SourceGit
隐藏其他
显示全部
diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml
index bb8f0ea87..feaf2e076 100644
--- a/src/Resources/Locales/zh_TW.axaml
+++ b/src/Resources/Locales/zh_TW.axaml
@@ -21,6 +21,7 @@
重新產生
使用 AI 產生提交訊息
套用
+ 套用並提交
隱藏 SourceGit
隱藏其他
顯示全部
diff --git a/src/ViewModels/AIAssistant.cs b/src/ViewModels/AIAssistant.cs
index d5a0783ca..be22385d7 100644
--- a/src/ViewModels/AIAssistant.cs
+++ b/src/ViewModels/AIAssistant.cs
@@ -38,6 +38,12 @@ public bool IsGenerating
private set => SetProperty(ref _isGenerating, value);
}
+ public bool CommitAfterUse
+ {
+ get => Preferences.Instance.AIAssistantCommitAfterUse;
+ set => Preferences.Instance.AIAssistantCommitAfterUse = value;
+ }
+
public string Text
{
get => _text;
@@ -170,6 +176,12 @@ public void Use(string text)
_repo.SetCommitMessage(text);
}
+ public async Task CommitAsync()
+ {
+ if (_repo.WorkingCopy is { } workingCopy)
+ await workingCopy.CommitAsync(false, false);
+ }
+
public void Cancel()
{
_cancel?.Cancel();
diff --git a/src/ViewModels/Preferences.cs b/src/ViewModels/Preferences.cs
index 7cd3665d8..1725b6264 100644
--- a/src/ViewModels/Preferences.cs
+++ b/src/ViewModels/Preferences.cs
@@ -141,6 +141,16 @@ public int SubjectGuideLength
set => SetProperty(ref _subjectGuideLength, value);
}
+ public bool AIAssistantCommitAfterUse
+ {
+ get => _aiAssistantCommitAfterUse;
+ set
+ {
+ if (SetProperty(ref _aiAssistantCommitAfterUse, value) && !_isLoading)
+ Save();
+ }
+ }
+
public int DateTimeFormat
{
get => Models.DateTimeFormat.ActiveIndex;
@@ -808,6 +818,7 @@ private bool RemoveInvalidRepositoriesRecursive(List collection)
private int _maxHistoryCommits = 20000;
private int _subjectGuideLength = 50;
+ private bool _aiAssistantCommitAfterUse = false;
private bool _useFixedTabWidth = true;
private bool _useAutoHideScrollBars = true;
private bool _useGitHubStyleAvatar = true;
diff --git a/src/Views/AIAssistant.axaml b/src/Views/AIAssistant.axaml
index 23bdb3f3a..033aee4ed 100644
--- a/src/Views/AIAssistant.axaml
+++ b/src/Views/AIAssistant.axaml
@@ -45,7 +45,7 @@
Content="{Binding Text}"/>
-
+
@@ -59,17 +59,37 @@
ItemsSource="{Binding AvailableModels, Mode=OneWay}"
SelectedItem="{Binding SelectedModel, Mode=TwoWay}"/>
-
+
+ AutomationProperties.Name="{DynamicResource Text.AIAssistant.Use}"
+ Click="OnUseClicked">
+
+
+
+
+
+
+
+
+
+
+
+
+
+