@@ -44,34 +44,33 @@ export class InsightTemplateHtml
4444
4545 const { insight } = this . data ;
4646
47+ let startTime = '' ;
4748 let formattedStartTime = '' ;
49+ let hasCustomTime = false ;
4850
4951 const menuItems = [ ] ;
5052 if ( ( < CodeObjectInsight > insight ) ?. prefixedCodeObjectId ) {
5153 const codeObjectInsight = < CodeObjectInsight > insight ;
5254 const {
5355 prefixedCodeObjectId : codeObjectId ,
5456 type : insightType ,
57+ actualStartTime,
5558 customStartTime,
5659 } = codeObjectInsight ;
5760
5861 console . log ( 'insight' , codeObjectId , insightType , customStartTime ) ;
5962
60- formattedStartTime = customStartTime ?. toDateString ( ) || formattedStartTime ;
61-
62- const customStartDateLinkStates = {
63- unset : { label : 'Recalculate' , action : 'reset' } ,
64- } ;
65- const state = customStartDateLinkStates . unset ;
63+ startTime = actualStartTime ?. format ( 'L' ) || '' ;
64+ formattedStartTime = actualStartTime ?. fromNow ( ) || formattedStartTime ;
65+ hasCustomTime = ! ! customStartTime ;
6666
6767 menuItems . push ( `
6868 <li
6969 class="list-item-menu-item custom-start-date-recalculate-link"
7070 data-code-object-id="${ codeObjectId } "
7171 data-insight-type="${ insightType } "
7272 >
73- <i class="codicon codicon-calendar"></i>
74- ${ state . label }
73+ Recalculate
7574 </li>
7675 ` ) ;
7776 }
@@ -88,6 +87,18 @@ export class InsightTemplateHtml
8887 </li>
8988 </ul>`
9089 : `` ;
90+ // const menuItemsHtml = menuItems.length > 0
91+ // ? `<li class="list-item-menu-item">
92+ // <img class="list-item-icon" src="${threeDotImageUri}" height="15">
93+ // <ul>
94+ // ${menuItems.join("")}
95+ // </ul>
96+ // </li>`
97+ // : ``;
98+ // const menuHtml = `
99+ // <ul class="list-item-menu sf-menu sf-js-enabled">
100+ // ${menuItemsHtml}
101+ // </ul>`;
91102
92103 let title = "" ;
93104 let tooltip = "" ;
@@ -99,11 +110,13 @@ export class InsightTemplateHtml
99110 tooltip = ( < ITitle > this . data . title ) . tooltip ;
100111 }
101112
113+ const timeInfoVisibilityClass = hasCustomTime ? '' : 'hidden' ;
102114 const timeInfoHtml = `
103- <div class="list-item-time-info hidden ">
104- <span class="list-item-time-info-message">Insight calculated since ${ formattedStartTime } </span>
115+ <div class="list-item-time-info ${ timeInfoVisibilityClass } ">
116+ <span class="list-item-time-info-message" title=" ${ startTime } ">Age of data: ${ formattedStartTime } </span>
105117 <a href="#" class="custom-start-date-refresh-link">Refresh</a>
106- </div>` ;
118+ </div>
119+ ` ;
107120
108121 const html = /*html*/ `
109122 <div class="list-item insight">
0 commit comments