@@ -36,6 +36,7 @@ export type GraphMinimapMarker = BranchMarker | RemoteMarker | StashMarker | Tag
3636export interface GraphMinimapSearchResultMarker {
3737 type : 'search-result' ;
3838 sha : string ;
39+ count : number ;
3940}
4041
4142export interface GraphMinimapStats {
@@ -355,6 +356,24 @@ const styles = css`
355356 margin : 0.5rem 0 ;
356357 }
357358
359+ .bb-tooltip .results {
360+ display : flex;
361+ font-size : 12px ;
362+ gap : 0.5rem ;
363+ flex-direction : row;
364+ flex-wrap : wrap;
365+ margin : 0.5rem 0 ;
366+ max-width : fit-content;
367+ }
368+
369+ .bb-tooltip .results .result {
370+ border-radius : 3px ;
371+ padding : 0 4px ;
372+ background-color : var (--color-graph-minimap-tip-highlightBackground );
373+ border : 1px solid var (--color-graph-minimap-tip-highlightBorder );
374+ color : var (--color-graph-minimap-tip-highlightForeground );
375+ }
376+
358377 .bb-tooltip .refs {
359378 display : flex;
360379 font-size : 12px ;
@@ -871,46 +890,53 @@ export class GraphMinimap extends FASTElement {
871890 contents : ( data , _defaultTitleFormat , _defaultValueFormat , _color ) => {
872891 const date = new Date ( data [ 0 ] . x ) ;
873892
874- const stat = this . data ?. get ( getDay ( date ) ) ;
875- const markers = this . markers ?. get ( getDay ( date ) ) ;
893+ const day = getDay ( date ) ;
894+ const stat = this . data ?. get ( day ) ;
895+ const markers = this . markers ?. get ( day ) ;
896+ const results = this . searchResults ?. get ( day ) ;
897+
876898 let groups ;
877899 if ( markers ?. length ) {
878900 groups = groupByMap ( markers , m => m . type ) ;
879901 }
880902
881903 const stashesCount = groups ?. get ( 'stash' ) ?. length ?? 0 ;
882- const showLinesChanged = this . dataType === 'lines' ;
904+
905+ let commits ;
906+ let linesChanged ;
907+ let resultsCount ;
908+ if ( stat ?. commits ) {
909+ commits = pluralize ( 'commit' , stat . commits , { format : c => formatNumeric ( c ) } ) ;
910+ if ( results ?. count ) {
911+ resultsCount = pluralize ( 'matching commit' , results . count ) ;
912+ }
913+
914+ if ( this . dataType === 'lines' ) {
915+ linesChanged = `${ pluralize ( 'file' , stat ?. files ?? 0 , {
916+ format : c => formatNumeric ( c ) ,
917+ zero : 'No' ,
918+ } ) } , ${ pluralize (
919+ 'line' ,
920+ ( stat ?. activity ?. additions ?? 0 ) + ( stat ?. activity ?. deletions ?? 0 ) ,
921+ {
922+ format : c => formatNumeric ( c ) ,
923+ zero : 'No' ,
924+ } ,
925+ ) } changed`;
926+ }
927+ } else {
928+ commits = 'No commits' ;
929+ }
883930
884931 return /*html*/ `<div class="bb-tooltip">
885932 <div class="header">
886933 <span class="header--title">${ formatDate ( date , 'MMMM Do, YYYY' ) } </span>
887934 <span class="header--description">(${ capitalize ( fromNow ( date ) ) } )</span>
888935 </div>
889936 <div class="changes">
890- <span>${
891- ( stat ?. commits ?? 0 ) === 0
892- ? 'No commits'
893- : `${ pluralize ( 'commit' , stat ?. commits ?? 0 , {
894- format : c => formatNumeric ( c ) ,
895- zero : 'No' ,
896- } ) } ${
897- showLinesChanged
898- ? `, ${ pluralize ( 'file' , stat ?. files ?? 0 , {
899- format : c => formatNumeric ( c ) ,
900- zero : 'No' ,
901- } ) } , ${ pluralize (
902- 'line' ,
903- ( stat ?. activity ?. additions ?? 0 ) +
904- ( stat ?. activity ?. deletions ?? 0 ) ,
905- {
906- format : c => formatNumeric ( c ) ,
907- zero : 'No' ,
908- } ,
909- ) } changed`
910- : ''
911- } `
912- } </span>
937+ <span>${ commits } ${ linesChanged ? `, ${ linesChanged } ` : '' } </span>
913938 </div>
939+ ${ resultsCount ? /*html*/ `<div class="results"><span class="result">${ resultsCount } </span></div>` : '' }
914940 ${
915941 groups != null
916942 ? /*html*/ `
0 commit comments