Skip to content

Commit 12081dc

Browse files
committed
Refactor commit message handling to display success notification before creating a checkpoint and clarify settings descriptions
1 parent 1ebf84d commit 12081dc

4 files changed

Lines changed: 13 additions & 13 deletions

File tree

‎packages/vscode/package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,14 +522,14 @@
522522
"codeWebChat.commitMessageInstructions": {
523523
"type": "string",
524524
"scope": "resource",
525-
"description": "The instructions used when generating a commit message.",
525+
"description": "Style and conventions (e.g. Conventional Commits, gitmoji) for generated commit messages.",
526526
"default": "Write a brief and precise summary for the changes, limited to a single sentence if possible and nothing else. Use an imperative tone to ensure clarity and focus on the primary change or purpose."
527527
},
528528
"codeWebChat.commitMessageAutoAcceptAfter": {
529529
"type": "number",
530530
"scope": "resource",
531531
"default": 5,
532-
"description": "Automatically accept commit message after a specified number of seconds."
532+
"description": "Automatically accept the generated commit message after a specified number of seconds."
533533
},
534534
"codeWebChat.contextSizeWarningThreshold": {
535535
"type": "number",

‎packages/vscode/src/views/panel/backend/message-handlers/handle-accept-commit-message.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ export const handle_accept_commit_message = async (
2929

3030
const title = 'Committed changes'
3131
const description = commit_message
32+
const commit_message_lines = commit_message.split('\n')
33+
const shortened_commit_message = commit_message_lines.length
34+
? `${commit_message_lines[0]}...`
35+
: commit_message_lines[0]
36+
vscode.window.showInformationMessage(
37+
dictionary.information_message.COMMIT_CREATED_SUCCESSFULLY(
38+
shortened_commit_message
39+
)
40+
)
3241
await create_checkpoint(
3342
panel_provider.workspace_provider,
3443
panel_provider.context,

‎packages/vscode/src/views/panel/backend/message-handlers/handle-commit-changes/handle-commit-changes.ts‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,6 @@ async function proceed_with_commit_generation(
7070
await handle_accept_commit_message(panel_provider, commit_message)
7171
panel_provider.send_message({ command: 'COMMIT_PROCESS_CANCELLED' })
7272
panel_provider.commit_was_staged_by_script = false
73-
const commit_message_lines = commit_message.split('\n')
74-
const shortened_commit_message = commit_message_lines.length
75-
? `${commit_message_lines[0]}...`
76-
: commit_message_lines[0]
77-
vscode.window.showInformationMessage(
78-
dictionary.information_message.COMMIT_CREATED_SUCCESSFULLY(
79-
shortened_commit_message
80-
)
81-
)
8273
}
8374
} catch (error) {
8475
if (panel_provider.commit_was_staged_by_script) {

‎packages/vscode/src/views/settings/frontend/Home/Home.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,13 +462,13 @@ export const Home: React.FC<Props> = (props) => {
462462
/>
463463
<Item
464464
title="Modal Duration"
465-
description="Automatically accept commit message after a specified number of seconds."
465+
description="Automatically accept the generated commit message after a specified number of seconds. Set 0 to disable the modal."
466466
slot={
467467
<Input
468468
type="number"
469469
value={commit_message_auto_accept_after_str}
470470
onChange={set_commit_message_auto_accept_after_str}
471-
max_width={100}
471+
max_width={60}
472472
/>
473473
}
474474
/>

0 commit comments

Comments
 (0)