@@ -876,7 +876,7 @@ class ViewModel {
876876 item . disposable . dispose ( ) ;
877877 }
878878
879- this . refresh ( item ) ;
879+ this . refresh ( ) ;
880880 }
881881
882882 private createGroupItem ( group : ISCMResourceGroup ) : IGroupItem {
@@ -899,7 +899,9 @@ class ViewModel {
899899 }
900900
901901 private onDidSpliceGroup ( item : IGroupItem , { start, deleteCount, toInsert } : ISplice < ISCMResource > ) : void {
902+ const before = item . resources . length ;
902903 const deleted = item . resources . splice ( start , deleteCount , ...toInsert ) ;
904+ const after = item . resources . length ;
903905
904906 if ( this . _mode === ViewModelMode . Tree ) {
905907 for ( const resource of deleted ) {
@@ -911,8 +913,11 @@ class ViewModel {
911913 }
912914 }
913915
914- // TODO@joao : this is here because we hide the input box when there are no changes
915- this . refresh ( ) ;
916+ if ( before !== after && ( before === 0 || after === 0 ) ) {
917+ this . refresh ( ) ;
918+ } else {
919+ this . refresh ( item ) ;
920+ }
916921 }
917922
918923 setVisible ( visible : boolean ) : void {
@@ -948,12 +953,15 @@ class ViewModel {
948953 private render ( item : IRepositoryItem | IGroupItem ) : ICompressedTreeElement < TreeElement > {
949954 if ( isRepositoryItem ( item ) ) {
950955 const children : ICompressedTreeElement < TreeElement > [ ] = [ ] ;
956+ const hasSomeChanges = item . groupItems . some ( item => item . element . elements . length > 0 ) ;
951957
952- if ( item . element . input . visible && item . groupItems . some ( item => item . element . elements . length > 0 ) ) {
953- children . push ( { element : item . element . input , incompressible : true , collapsible : false } ) ;
954- }
958+ if ( this . items . length === 1 || hasSomeChanges ) {
959+ if ( item . element . input . visible ) {
960+ children . push ( { element : item . element . input , incompressible : true , collapsible : false } ) ;
961+ }
955962
956- children . push ( ...item . groupItems . map ( i => this . render ( i ) ) ) ;
963+ children . push ( ...item . groupItems . map ( i => this . render ( i ) ) ) ;
964+ }
957965
958966 return { element : item . element , children, incompressible : true , collapsible : true } ;
959967 } else {
@@ -1372,12 +1380,9 @@ class SCMInputWidget extends Disposable {
13721380 const dimension : Dimension = {
13731381 width : this . element . clientWidth - 2 ,
13741382 height : editorHeight ,
1375- // height: editorHeight - 2
13761383 } ;
13771384
1378- // templateData.input.layout(/* { height: editorHeight, width: this.layoutCache.width! - 12 - 2 - 2 } */);
13791385 this . inputEditor . layout ( dimension ) ;
1380- // this.validationContainer.style.top = `${dimension.height + 1}px`;
13811386 }
13821387
13831388 private getInputEditorFontFamily ( ) : string {
0 commit comments