@@ -432,6 +432,11 @@ export class IntegrationWebviewProvider implements IIntegrationWebviewProvider {
432432 await this . saveConfiguration ( message . integrationId , message . config ) ;
433433 }
434434 break ;
435+ case 'reset' :
436+ if ( message . integrationId ) {
437+ await this . resetConfiguration ( message . integrationId ) ;
438+ }
439+ break ;
435440 case 'delete' :
436441 if ( message . integrationId ) {
437442 await this . deleteConfiguration ( message . integrationId ) ;
@@ -508,9 +513,9 @@ export class IntegrationWebviewProvider implements IIntegrationWebviewProvider {
508513 }
509514
510515 /**
511- * Delete the configuration for an integration
516+ * Reset the configuration for an integration (clears credentials but keeps the integration entry)
512517 */
513- private async deleteConfiguration ( integrationId : string ) : Promise < void > {
518+ private async resetConfiguration ( integrationId : string ) : Promise < void > {
514519 try {
515520 await this . integrationStorage . delete ( integrationId ) ;
516521
@@ -527,14 +532,44 @@ export class IntegrationWebviewProvider implements IIntegrationWebviewProvider {
527532
528533 await this . updateWebview ( ) ;
529534 await this . currentPanel ?. webview . postMessage ( {
530- message : l10n . t ( 'Configuration deleted successfully' ) ,
535+ message : l10n . t ( 'Configuration reset successfully' ) ,
536+ type : 'success'
537+ } ) ;
538+ } catch ( error ) {
539+ logger . error ( 'Failed to reset integration configuration' , error ) ;
540+ await this . currentPanel ?. webview . postMessage ( {
541+ message : l10n . t (
542+ 'Failed to reset configuration: {0}' ,
543+ error instanceof Error ? error . message : 'Unknown error'
544+ ) ,
545+ type : 'error'
546+ } ) ;
547+ }
548+ }
549+
550+ /**
551+ * Delete the integration completely (removes credentials and integration entry)
552+ */
553+ private async deleteConfiguration ( integrationId : string ) : Promise < void > {
554+ try {
555+ await this . integrationStorage . delete ( integrationId ) ;
556+
557+ // Remove from local state
558+ this . integrations . delete ( integrationId ) ;
559+
560+ // Update the project's integrations list
561+ await this . updateProjectIntegrationsList ( ) ;
562+
563+ await this . updateWebview ( ) ;
564+ await this . currentPanel ?. webview . postMessage ( {
565+ message : l10n . t ( 'Integration deleted successfully' ) ,
531566 type : 'success'
532567 } ) ;
533568 } catch ( error ) {
534- logger . error ( 'Failed to delete integration configuration ' , error ) ;
569+ logger . error ( 'Failed to delete integration' , error ) ;
535570 await this . currentPanel ?. webview . postMessage ( {
536571 message : l10n . t (
537- 'Failed to delete configuration : {0}' ,
572+ 'Failed to delete integration : {0}' ,
538573 error instanceof Error ? error . message : 'Unknown error'
539574 ) ,
540575 type : 'error'
0 commit comments