@@ -114,16 +114,46 @@ ${fileDiff}
114114 . map ( ( key ) => {
115115 const rollup = rollupGrouping [ key ] ;
116116 let outString = '' ;
117- let title = rollup . files [ 0 ] ;
117+ let title ;
118+
119+ // Create descriptive title based on file count and type
120+ if ( rollup . files . length === 1 ) {
121+ title = rollup . files [ 0 ] ;
122+ } else {
123+ const fileCount = rollup . files . length ;
124+ if ( key === 'identical' ) {
125+ title = `${ fileCount } files identical` ;
126+ } else if ( key === 'old 1' ) {
127+ title = `${ fileCount } files only in old changeset` ;
128+ } else if ( key === 'new 2' ) {
129+ title = `${ fileCount } files only in new changeset` ;
130+ } else {
131+ title = `${ fileCount } files changed` ;
132+ }
133+ }
134+
118135 // If there's more than one file in the rollup, list them
119136 if ( rollup . files . length > 1 ) {
120- title += ` (${ rollup . files . length - 1 } more)` ;
121137 outString += '\n' ;
122138 for ( const file of rollup . files ) {
123139 outString += `- ${ file } \n` ;
124140 }
141+
142+ // Simple replacement of the last filename with additional info
143+ if ( rollup . string . includes ( '```diff' ) ) {
144+ const lastFileName = rollup . files [ rollup . files . length - 1 ] ;
145+ const modifiedDiff = rollup . string . replace (
146+ `--- ${ lastFileName } ` ,
147+ `--- ${ lastFileName } (and ${ rollup . files . length - 1 } other files)` ,
148+ ) ;
149+ outString += '\n\n' + modifiedDiff ;
150+ } else {
151+ outString += '\n\n' + rollup . string ;
152+ }
153+ } else {
154+ outString += '\n\n' + rollup . string ;
125155 }
126- outString += '\n\n' + rollup . string ;
156+
127157 return renderDetails ( title , outString , isOpen ) ;
128158 } )
129159 . join ( '\n' ) ;
@@ -178,6 +208,6 @@ for (const [
178208 files ,
179209] of Object . entries ( sections ) ) {
180210 const isOpen = section === 'latest' ;
181- const fileOut = displayDiffs ( files . dir1 , files . dir2 , isOpen ) ;
211+ const fileOut = displayDiffs ( files . dir1 || { } , files . dir2 || { } , isOpen ) ;
182212 console . log ( renderDetails ( section , fileOut , isOpen ) ) ;
183213}
0 commit comments