@@ -112,8 +112,6 @@ export const MainView: React.FC<Props> = (props) => {
112112 useState ( false )
113113 const [ is_apply_disabled_temporarily , set_is_apply_disabled_temporarily ] =
114114 useState ( false )
115- const [ is_undo_disabled_temporarily , set_is_undo_disabled_temporarily ] =
116- useState ( false )
117115
118116 const calculate_dropdown_max_width = ( ) => {
119117 if ( ! container_ref . current || ! top_left_ref . current ) return
@@ -160,7 +158,6 @@ export const MainView: React.FC<Props> = (props) => {
160158 if ( props . home_view_type == HOME_VIEW_TYPES . WEB ) {
161159 props . initialize_chats ( { } )
162160 } else {
163- set_is_undo_disabled_temporarily ( false )
164161 if ( is_in_code_completions_mode ) {
165162 props . on_code_completion_click ( )
166163 } else {
@@ -173,7 +170,6 @@ export const MainView: React.FC<Props> = (props) => {
173170 if ( props . home_view_type == HOME_VIEW_TYPES . WEB ) {
174171 props . initialize_chats ( { show_quick_pick : true } )
175172 } else {
176- set_is_undo_disabled_temporarily ( false )
177173 if ( is_in_code_completions_mode ) {
178174 props . on_code_completion_with_quick_pick_click ( )
179175 } else {
@@ -198,12 +194,7 @@ export const MainView: React.FC<Props> = (props) => {
198194 } , [ props . can_undo ] )
199195
200196 const handle_undo_click = ( ) => {
201- if ( ! props . can_undo ) return
202-
203- set_is_undo_disabled_temporarily ( true )
204197 props . on_quick_action_click ( 'codeWebChat.undo' )
205-
206- setTimeout ( ( ) => set_is_undo_disabled_temporarily ( false ) , 10000 )
207198 }
208199
209200 const handle_commit_click = ( ) => {
@@ -434,6 +425,19 @@ export const MainView: React.FC<Props> = (props) => {
434425 </ a >
435426 </ div >
436427 < div className = { styles . footer__right } >
428+ < button
429+ className = { cn (
430+ styles . footer__button ,
431+ styles [ 'footer__button--outlined' ]
432+ ) }
433+ onClick = { handle_undo_click }
434+ title = {
435+ 'Restore saved state of the codebase after chat/API response integration'
436+ }
437+ disabled = { ! props . can_undo }
438+ >
439+ Undo
440+ </ button >
437441 { props . home_view_type == HOME_VIEW_TYPES . WEB && (
438442 < button
439443 className = { cn (
@@ -444,24 +448,9 @@ export const MainView: React.FC<Props> = (props) => {
444448 title = { 'Integrate copied message or a code block' }
445449 disabled = { is_apply_disabled_temporarily }
446450 >
447- APPLY
451+ Apply clipboard
448452 </ button >
449453 ) }
450- < button
451- className = { cn (
452- styles . footer__button ,
453- styles [ 'footer__button--outlined' ]
454- ) }
455- onClick = { handle_undo_click }
456- title = {
457- props . can_undo
458- ? 'Restore saved state of the codebase after chat/API response integration'
459- : 'Nothing to undo'
460- }
461- disabled = { ! props . can_undo || is_undo_disabled_temporarily }
462- >
463- UNDO
464- </ button >
465454 < button
466455 className = { cn (
467456 styles . footer__button ,
@@ -477,7 +466,7 @@ export const MainView: React.FC<Props> = (props) => {
477466 ! props . has_changes_to_commit || is_commit_disabled_temporarily
478467 }
479468 >
480- COMMIT
469+ Commit changes
481470 </ button >
482471 </ div >
483472 </ div >
0 commit comments