Skip to content

Commit 81f1d5b

Browse files
committed
Refactor commit message generation to support interactive action selection and chatbot autofill
- before showing a list of configurations (or using the default one) show a quick pick with 2 options: Make API request, Copy prompt - rename 'make api request' to 'Generate with API call' (also translation key) - rename 'make api request' to 'Call API for commit message' (also translation key) - add missing translations [Fragment] - rename [Fragment] to 'make api call for commit message' (with translation key and other languages) - implement option "Enter commit message manually", place below "Make api call for commit message" - remove standalone command 'copyCommitMessagePrompt' - remove standalone command 'applyCommitMessageFromClipboard' - implement 'commit message action': 'autofill in chatbot' - 'generate commit message command' should have direct access to websockets, not via `apps/editor/src/views/prompt/backend/prompt-view-provider.ts`, should use native notifcations instead of auto closing modals - 'initialize chat message' should have optional key 'is for commit message', if true, the browser extension should display the 'apply response' button - in `apps/editor/src/commands/generate-commit-message-command/actions/run-generate-action.ts` should highlight last used web configuration - move `apps/editor/src/features/commit-messages/utils` close to the command itself - 'commit message action' quick pick should have close button - rename 'make api call for commit message' to 'make api call' (with translation key and other translations) - rename 'enter commit message manually' to 'enter manually' (with translation key and other translations) - in 'commit message action', remeber last choice - should close 'commit message action' on outside clicks - should not show option 'autofill in chatbot' if not connected with browser - in 'commit message action' should not highlight any option if none was last used - add missing translations to [Fragment] ├── apps │ ├── browser │ │ └── src │ │ ├── background │ │ │ ├── clear-chat-init-data.ts │ │ │ ├── config.ts │ │ │ ├── keep-alive.ts │ │ │ ├── main.ts │ │ │ ├── message-handler.ts │ │ │ └── websocket.ts │ │ ├── content-scripts │ │ │ └── send-prompt-content-script │ │ │ ├── send-prompt-content-script.ts │ │ │ └── types │ │ │ └── chatbot.ts │ │ ├── manifest.json │ │ └── types │ │ └── messages.ts │ └── editor │ ├── package.json │ ├── package.nls.bg.json │ ├── package.nls.cs.json │ ├── package.nls.de.json │ ├── package.nls.es.json │ ├── package.nls.fr.json │ ├── package.nls.hu.json │ ├── package.nls.it.json │ ├── package.nls.ja.json │ ├── package.nls.json │ ├── package.nls.ko.json │ ├── package.nls.pl.json │ ├── package.nls.pt-br.json │ ├── package.nls.ru.json │ ├── package.nls.tr.json │ ├── package.nls.zh-cn.json │ ├── package.nls.zh-tw.json │ └── src │ ├── commands │ │ ├── code-at-cursor-command │ │ │ └── utils │ │ │ └── get-code-at-cursor-config.ts │ │ └── generate-commit-message-command │ │ ├── actions │ │ │ ├── get-prompt-data.ts │ │ │ └── run-generate-action.ts │ │ ├── generate-commit-message-command.ts │ │ ├── index.ts │ │ └── utils │ │ ├── build-commit-message-prompt.ts │ │ ├── generate-commit-message-with-api.ts │ │ ├── get-commit-message-config.ts │ │ └── strip-wrapping-quotes.ts │ ├── constants │ │ ├── instructions.ts │ │ └── state-keys.ts │ ├── extension.ts │ ├── features │ │ ├── commit-messages │ │ │ ├── index.ts │ │ │ └── utils │ │ │ ├── build-commit-message-prompt.ts │ │ │ ├── generate-commit-message-with-api.ts │ │ │ ├── get-commit-message-config.ts │ │ │ └── strip-wrapping-quotes.ts │ │ └── search-files │ │ └── utils │ │ └── prompt-for-config.ts │ ├── i18n │ │ └── translations │ │ ├── commands │ │ │ └── generate-commit-message.ts │ │ └── features │ │ ├── imported-files.ts │ │ └── index.ts │ ├── services │ │ └── websocket-manager.ts │ ├── utils │ │ └── show-configuration-quick-pick.ts │ └── views │ └── prompt │ └── backend │ ├── message-handlers │ │ ├── handle-autofill.ts │ │ ├── handle-make-api-call.ts │ │ ├── handle-update-last-used-web-configuration.ts │ │ ├── handle-voice-input.ts │ │ └── utils │ │ └── intelligent-update-utils.ts │ └── prompt-view-provider.ts └── packages └── shared └── src └── types ├── prompt-types.ts └── websocket-message.ts
1 parent e25ee81 commit 81f1d5b

34 files changed

Lines changed: 402 additions & 142 deletions

‎README.md‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ Install the [browser extension](https://github.com/robertpiosik/CodeWebChat/tree
185185
### Commit messages
186186

187187
- `Commit Changes` - Generate commit message in your preferred style and commit.
188-
- `Copy Commit Message Prompt` - Copy the prompt for generating a commit message.
189188
- `Apply Commit Message from Clipboard` - Apply a generated commit message from the clipboard.
190189

191190
### History

‎apps/browser/src/background/message-handler.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ const process_next_chat = async () => {
7878
},
7979
client_id: current_chat_message.client_id,
8080
raw_instructions: current_chat_message.raw_instructions,
81-
prompt_type: current_chat_message.prompt_type
81+
prompt_type: current_chat_message.prompt_type,
82+
is_for_commit_message: current_chat_message.is_for_commit_message
8283
}
8384
})
8485

‎apps/browser/src/content-scripts/send-prompt-content-script/send-prompt-content-script.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ const main = async () => {
194194
| 'code-at-cursor'
195195
| 'find-relevant-files'
196196
| 'without-files'
197+
is_for_commit_message?: boolean
197198
}
198199

199200
if (!stored_data) {
@@ -227,7 +228,8 @@ const main = async () => {
227228
const inject_button =
228229
stored_data.prompt_type == 'edit-files' ||
229230
stored_data.prompt_type == 'code-at-cursor' ||
230-
stored_data.prompt_type == 'find-relevant-files'
231+
stored_data.prompt_type == 'find-relevant-files' ||
232+
!!stored_data.is_for_commit_message
231233

232234
sessionStorage.setItem(
233235
session_data_key,

‎apps/editor/package.json‎

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -322,18 +322,6 @@
322322
"category": "Code Web Chat",
323323
"icon": "$(sparkle)"
324324
},
325-
{
326-
"command": "codeWebChat.copyCommitMessagePrompt",
327-
"title": "%codeWebChat.copyCommitMessagePrompt.title%",
328-
"category": "Code Web Chat",
329-
"icon": "$(copy)"
330-
},
331-
{
332-
"command": "codeWebChat.applyCommitMessageFromClipboard",
333-
"title": "%codeWebChat.applyCommitMessageFromClipboard.title%",
334-
"category": "Code Web Chat",
335-
"icon": "$(clippy)"
336-
},
337325
{
338326
"command": "codeWebChat.applyCommitMessageFromClipboardPalette",
339327
"title": "%codeWebChat.applyCommitMessageFromClipboardPalette.title%",
@@ -565,10 +553,6 @@
565553
"command": "codeWebChat.generateCommitMessage",
566554
"when": "false"
567555
},
568-
{
569-
"command": "codeWebChat.applyCommitMessageFromClipboard",
570-
"when": "false"
571-
},
572556
{
573557
"command": "codeWebChat.visitWebsite",
574558
"when": "false"
@@ -785,16 +769,6 @@
785769
"command": "codeWebChat.generateCommitMessage",
786770
"group": "navigation@1",
787771
"when": "scmProvider == git"
788-
},
789-
{
790-
"command": "codeWebChat.copyCommitMessagePrompt",
791-
"group": "navigation@2",
792-
"when": "scmProvider == git"
793-
},
794-
{
795-
"command": "codeWebChat.applyCommitMessageFromClipboard",
796-
"group": "navigation@3",
797-
"when": "scmProvider == git"
798772
}
799773
],
800774
"editor/title": [

‎apps/editor/package.nls.bg.json‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@
3939
"codeWebChat.createNewCheckpoint.title": "Създай нова контролна точка",
4040
"codeWebChat.settings.title": "Настройки",
4141
"codeWebChat.generateCommitMessage.title": "Генерирай commit съобщение с CWC",
42-
"codeWebChat.copyCommitMessagePrompt.title": "Копирай промпт за commit",
43-
"codeWebChat.applyCommitMessageFromClipboard.title": "Приложи от клипборда",
4442
"codeWebChat.applyCommitMessageFromClipboardPalette.title": "Приложи commit съобщение от клипборда",
4543
"codeWebChat.generateCommitMessageAndCommit.title": "Потвърди промените",
4644
"codeWebChat.setRanges.title": "Задай диапазони...",

‎apps/editor/package.nls.cs.json‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@
3939
"codeWebChat.createNewCheckpoint.title": "Vytvořit nový kontrolní bod",
4040
"codeWebChat.settings.title": "Nastavení",
4141
"codeWebChat.generateCommitMessage.title": "Generovat zprávu commitu pomocí CWC",
42-
"codeWebChat.copyCommitMessagePrompt.title": "Kopírovat prompt zprávy commitu",
43-
"codeWebChat.applyCommitMessageFromClipboard.title": "Použít ze schránky",
4442
"codeWebChat.applyCommitMessageFromClipboardPalette.title": "Použít zprávu commitu ze schránky",
4543
"codeWebChat.generateCommitMessageAndCommit.title": "Potvrdit změny",
4644
"codeWebChat.setRanges.title": "Nastavit rozsahy...",

‎apps/editor/package.nls.de.json‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@
3939
"codeWebChat.createNewCheckpoint.title": "Neuen Checkpoint erstellen",
4040
"codeWebChat.settings.title": "Einstellungen",
4141
"codeWebChat.generateCommitMessage.title": "Commit-Nachricht mit CWC generieren",
42-
"codeWebChat.copyCommitMessagePrompt.title": "Commit-Nachricht-Prompt kopieren",
43-
"codeWebChat.applyCommitMessageFromClipboard.title": "Aus Zwischenablage anwenden",
4442
"codeWebChat.applyCommitMessageFromClipboardPalette.title": "Commit-Nachricht aus Zwischenablage anwenden",
4543
"codeWebChat.generateCommitMessageAndCommit.title": "Änderungen committen",
4644
"codeWebChat.setRanges.title": "Bereiche festlegen...",

‎apps/editor/package.nls.es.json‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@
3939
"codeWebChat.createNewCheckpoint.title": "Crear nuevo punto de control",
4040
"codeWebChat.settings.title": "Configuración",
4141
"codeWebChat.generateCommitMessage.title": "Generar mensaje de commit con CWC",
42-
"codeWebChat.copyCommitMessagePrompt.title": "Copiar prompt del mensaje de commit",
43-
"codeWebChat.applyCommitMessageFromClipboard.title": "Aplicar desde el portapapeles",
4442
"codeWebChat.applyCommitMessageFromClipboardPalette.title": "Aplicar mensaje de commit desde el portapapeles",
4543
"codeWebChat.generateCommitMessageAndCommit.title": "Hacer commit de los cambios",
4644
"codeWebChat.setRanges.title": "Establecer rangos...",

‎apps/editor/package.nls.fr.json‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@
3939
"codeWebChat.createNewCheckpoint.title": "Créer un nouveau point de contrôle",
4040
"codeWebChat.settings.title": "Paramètres",
4141
"codeWebChat.generateCommitMessage.title": "Générer un message de commit avec CWC",
42-
"codeWebChat.copyCommitMessagePrompt.title": "Copiar le prompt du message de commit",
43-
"codeWebChat.applyCommitMessageFromClipboard.title": "Appliquer depuis le presse-papiers",
4442
"codeWebChat.applyCommitMessageFromClipboardPalette.title": "Appliquer le message de commit depuis le presse-papiers",
4543
"codeWebChat.generateCommitMessageAndCommit.title": "Valider les modifications",
4644
"codeWebChat.setRanges.title": "Définir les plages...",

‎apps/editor/package.nls.hu.json‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@
3939
"codeWebChat.createNewCheckpoint.title": "Új ellenőrzőpont létrehozása",
4040
"codeWebChat.settings.title": "Beállítások",
4141
"codeWebChat.generateCommitMessage.title": "Commit üzenet generálása CWC-vel",
42-
"codeWebChat.copyCommitMessagePrompt.title": "Commit üzenet prompt másolása",
43-
"codeWebChat.applyCommitMessageFromClipboard.title": "Alkalmazás vágólapról",
4442
"codeWebChat.applyCommitMessageFromClipboardPalette.title": "Commit üzenet alkalmazása vágólapról",
4543
"codeWebChat.generateCommitMessageAndCommit.title": "Változások commitálása",
4644
"codeWebChat.setRanges.title": "Tartományok beállítása...",

0 commit comments

Comments
 (0)