@@ -184,6 +184,7 @@ class GitGraphView {
184184 name : this . gitRepos [ this . currentRepo ] . name || getRepoName ( this . currentRepo )
185185 } , 'Opening Terminal' ) ;
186186 } ) ;
187+ this . gitRepos [ this . currentRepo ] . isCdvSummaryHidden = this . config . commitDetailsView . initiallyHideSummary ;
187188 }
188189
189190
@@ -838,7 +839,7 @@ class GitGraphView {
838839 }
839840
840841 const colHeadersElem = document . getElementById ( 'tableColHeaders' ) ;
841- const cdvHeight = this . gitRepos [ this . currentRepo ] . cdvHeight ;
842+ const cdvHeight = this . gitRepos [ this . currentRepo ] . isCdvSummaryHidden ? 0 : this . gitRepos [ this . currentRepo ] . cdvHeight ;
842843 const headerHeight = colHeadersElem !== null ? colHeadersElem . clientHeight + 1 : 0 ;
843844 const expandedCommit = this . isCdvDocked ( ) ? null : this . expandedCommit ;
844845 const expandedCommitElem = expandedCommit !== null ? document . getElementById ( 'cdv' ) : null ;
@@ -2608,7 +2609,7 @@ class GitGraphView {
26082609 }
26092610
26102611 if ( expandedCommit . loading ) {
2611- html += '<div id="cdvLoading">' + SVG_ICONS . loading + ' Loading ' + ( expandedCommit . compareWithHash === null ? expandedCommit . commitHash !== UNCOMMITTED ? 'Commit Details' : 'Uncommitted Changes' : 'Commit Comparison' ) + ' ...</div>' ;
2612+ html += '<div id="cdvFiles"></div><div id=" cdvLoading">' + SVG_ICONS . loading + ' Loading ' + ( expandedCommit . compareWithHash === null ? expandedCommit . commitHash !== UNCOMMITTED ? 'Commit Details' : 'Uncommitted Changes' : 'Commit Comparison' ) + ' ...</div>' ;
26122613 } else {
26132614 html += '<div id="cdvSummary">' ;
26142615 if ( expandedCommit . compareWithHash === null ) {
@@ -2648,16 +2649,17 @@ class GitGraphView {
26482649 // Commit comparison should be shown
26492650 html += 'Displaying all changes from <b>' + commitOrder . from + '</b> to <b>' + ( commitOrder . to !== UNCOMMITTED ? commitOrder . to : 'Uncommitted Changes' ) + '</b>.' ;
26502651 }
2651- html += '</div><div id="cdvFiles">' + generateFileViewHtml ( expandedCommit . fileTree ! , expandedCommit . fileChanges ! , expandedCommit . lastViewedFile , expandedCommit . contextMenuOpen . fileView , this . getFileViewType ( ) , commitOrder . to === UNCOMMITTED ) + '</div><div id="cdvDivider"></div>' ;
2652+ html += '</div><div id="cdvFiles">' + ( ! isDocked ? '<div id="cdvSummaryToggleBtn">' + SVG_ICONS . collapse + '</div>' : '' ) + '<div id="cdvFilesViewWrapper"><div id="cdvFilesView">' + generateFileViewHtml ( expandedCommit . fileTree ! , expandedCommit . fileChanges ! , expandedCommit . lastViewedFile , expandedCommit . contextMenuOpen . fileView , this . getFileViewType ( ) , commitOrder . to === UNCOMMITTED ) + '</div></div> </div><div id="cdvDivider"></div>' ;
26522653 }
26532654 html += '</div><div id="cdvControls"><div id="cdvClose" class="cdvControlBtn" title="Close">' + SVG_ICONS . close + '</div>' +
26542655 ( codeReviewPossible ? '<div id="cdvCodeReview" class="cdvControlBtn">' + SVG_ICONS . review + '</div>' : '' ) +
26552656 ( ! expandedCommit . loading ? '<div id="cdvFileViewTypeList" class="cdvControlBtn cdvFileViewTypeBtn" title="File List View">' + SVG_ICONS . fileList + '</div><div id="cdvFileViewTypeTree" class="cdvControlBtn cdvFileViewTypeBtn" title="File Tree View">' + SVG_ICONS . fileTree + '</div><div id="cdvCollapse" class="cdvControlBtn cdvFolderBtn" title="Collapse/Expand Folders">' + SVG_ICONS . collapseAll + '</div><div id="cdvExpand" class="cdvControlBtn cdvFolderBtn" title="Expand Folders">' + SVG_ICONS . expandAll + '</div>' : '' ) +
26562657 ( externalDiffPossible ? '<div id="cdvExternalDiff" class="cdvControlBtn">' + SVG_ICONS . linkExternal + '</div>' : '' ) +
26572658 '</div><div class="cdvHeightResize"></div>' ;
26582659
2659- elem . innerHTML = isDocked ? html : '<td><div class="cdvHeightResize"></div></td><td colspan="' + ( this . getNumColumns ( ) - 1 ) + '">' + html + '</td>' ;
2660- if ( ! expandedCommit . loading ) this . setCdvDivider ( ) ;
2660+ elem . innerHTML = isDocked ? html : '<td><div class="cdvHeightResize"></div></td><td colspan="' + ( this . getNumColumns ( ) - 1 ) + '"><div id="cdvContentWrapper">' + html + '</div></td>' ;
2661+ this . setCdvDivider ( ) ;
2662+ this . setCdvHeight ( elem , isDocked ) ;
26612663 if ( ! isDocked ) this . renderGraph ( ) ;
26622664
26632665 if ( ! refresh ) {
@@ -2730,6 +2732,12 @@ class GitGraphView {
27302732 document . getElementById ( 'cdvExpand' ) ! . addEventListener ( 'click' , ( ) => {
27312733 this . openFolders ( true ) ;
27322734 } ) ;
2735+ let cdvSummaryToggleBtn = document . getElementById ( 'cdvSummaryToggleBtn' ) ;
2736+ if ( cdvSummaryToggleBtn !== null ) cdvSummaryToggleBtn . addEventListener ( 'click' , ( ) => {
2737+ this . gitRepos [ this . currentRepo ] . isCdvSummaryHidden = ! ( this . gitRepos [ this . currentRepo ] . isCdvSummaryHidden ) ;
2738+ this . hideCdvSummary ( this . gitRepos [ this . currentRepo ] . isCdvSummaryHidden ) ;
2739+ } ) ;
2740+ this . hideCdvSummary ( this . gitRepos [ this . currentRepo ] . isCdvSummaryHidden ) ;
27332741
27342742 if ( codeReviewPossible ) {
27352743 this . renderCodeReviewBtn ( ) ;
@@ -2773,6 +2781,20 @@ class GitGraphView {
27732781 }
27742782 }
27752783
2784+ private hideCdvSummary ( hide : boolean ) {
2785+ let btnIcon = document . getElementById ( 'cdvSummaryToggleBtn' ) ?. getElementsByTagName ( 'svg' ) ?. [ 0 ] ?? null ;
2786+ let cdvSummary = document . getElementById ( 'cdvSummary' ) ;
2787+ if ( hide && ! this . isCdvDocked ( ) ) {
2788+ if ( btnIcon ) btnIcon . style . transform = 'rotate(90deg)' ;
2789+ cdvSummary ! . classList . add ( 'hidden' ) ;
2790+ } else {
2791+ if ( btnIcon ) btnIcon . style . transform = 'rotate(-90deg)' ;
2792+ cdvSummary ! . classList . remove ( 'hidden' ) ;
2793+ }
2794+ let elem = document . getElementById ( 'cdv' ) ;
2795+ if ( elem !== null ) this . setCdvHeight ( elem , this . isCdvDocked ( ) ) ;
2796+ }
2797+
27762798 private setCdvHeight ( elem : HTMLElement , isDocked : boolean ) {
27772799 let height = this . gitRepos [ this . currentRepo ] . cdvHeight , windowHeight = window . innerHeight ;
27782800 if ( height > windowHeight - 40 ) {
@@ -2784,8 +2806,24 @@ class GitGraphView {
27842806 }
27852807
27862808 let heightPx = height + 'px' ;
2787- elem . style . height = heightPx ;
2788- if ( isDocked ) this . viewElem . style . bottom = heightPx ;
2809+ if ( isDocked ) {
2810+ this . viewElem . style . bottom = heightPx ;
2811+ elem . style . height = heightPx ;
2812+ return ;
2813+ }
2814+ let inlineElem = document . getElementById ( 'cdvContentWrapper' ) ;
2815+ if ( ! inlineElem ) {
2816+ elem . style . height = heightPx ;
2817+ return ;
2818+ }
2819+ if ( this . gitRepos [ this . currentRepo ] . isCdvSummaryHidden ) {
2820+ inlineElem . style . height = heightPx ;
2821+ elem . style . height = '0px' ;
2822+ } else {
2823+ inlineElem . style . removeProperty ( 'height' ) ;
2824+ elem . style . height = heightPx ;
2825+ }
2826+ this . renderGraph ( ) ;
27892827 }
27902828
27912829 private setCdvDivider ( ) {
0 commit comments