File tree Expand file tree Collapse file tree
src/commands/generate-commit-message-command
packages/ui/src/components/editor/settings Expand file tree Collapse file tree Original file line number Diff line number Diff line change 308308 },
309309 {
310310 "command" : " codeWebChat.generateCommitMessage" ,
311- "title" : " Generate Commit Message with CWC " ,
311+ "title" : " CWC: Generate Commit Message" ,
312312 "category" : " Code Web Chat" ,
313313 "icon" : " $(sparkle)"
314314 },
315315 {
316316 "command" : " codeWebChat.copyCommitMessagePrompt" ,
317- "title" : " Copy Commit Message Prompt from CWC " ,
317+ "title" : " CWC: Copy Commit Message Prompt" ,
318318 "category" : " Code Web Chat" ,
319319 "icon" : " $(copy)"
320320 },
Original file line number Diff line number Diff line change @@ -51,9 +51,49 @@ export const generate_commit_message_command = (
5151 } )
5252
5353 if ( commit_message ) {
54- repository . inputBox . value = commit_message
5554 if ( should_commit ) {
56- await vscode . commands . executeCommand ( 'git.commit' , repository )
55+ const edited_message = await new Promise < string | undefined > (
56+ ( resolve ) => {
57+ const input_box = vscode . window . createInputBox ( )
58+ input_box . value = commit_message
59+ input_box . title = 'Commit Message'
60+ input_box . prompt = 'Review the commit message'
61+
62+ const close_button = {
63+ iconPath : new vscode . ThemeIcon ( 'close' ) ,
64+ tooltip : 'Close'
65+ }
66+
67+ input_box . buttons = [ close_button ]
68+
69+ input_box . onDidTriggerButton ( ( button ) => {
70+ if ( button == close_button ) {
71+ input_box . hide ( )
72+ }
73+ } )
74+
75+ input_box . onDidAccept ( ( ) => {
76+ resolve ( input_box . value )
77+ input_box . hide ( )
78+ } )
79+
80+ input_box . onDidHide ( ( ) => {
81+ resolve ( undefined )
82+ input_box . dispose ( )
83+ } )
84+
85+ input_box . show ( )
86+ }
87+ )
88+
89+ if ( edited_message ) {
90+ repository . inputBox . value = edited_message
91+ await vscode . commands . executeCommand ( 'git.commit' , repository )
92+ } else if ( was_empty_stage ) {
93+ await vscode . commands . executeCommand ( 'git.unstageAll' )
94+ }
95+ } else {
96+ repository . inputBox . value = commit_message
5797 }
5898 } else if ( was_empty_stage ) {
5999 await vscode . commands . executeCommand ( 'git.unstageAll' )
Original file line number Diff line number Diff line change 3535 height : var (--row-height );
3636 gap : 12px ;
3737 padding : 0 12px ;
38- user-select : text ;
3938
4039 & :nth-child (even ) {
4140 background-color : var (--cwc-bg-tertiary );
Original file line number Diff line number Diff line change 2929 height : var (--row-height );
3030 padding : 0 12px ;
3131 gap : 12px ;
32- user-select : text ;
3332
3433 & :nth-child (even ) {
3534 background-color : var (--cwc-bg-tertiary );
You can’t perform that action at this time.
0 commit comments