Skip to content

Commit e9e896f

Browse files
committed
Enhance tooltip content in summary view with detailed time spent and activity level
1 parent fb361c3 commit e9e896f

1 file changed

Lines changed: 27 additions & 2 deletions

File tree

src/summaryView.ts

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -837,10 +837,23 @@ export class SummaryViewProvider implements vscode.WebviewViewProvider {
837837
const dayOfWeek = currentDate.getDay();
838838
const dayNames = [ 'Saturday', 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'];
839839
840+
// Create detailed tooltip content
841+
const hours = Math.floor(minutes / 60);
842+
const mins = Math.round(minutes % 60);
843+
let intensity = 'No activity';
844+
if (level === 1) intensity = 'Light coding';
845+
if (level === 2) intensity = 'Moderate coding';
846+
if (level === 3) intensity = 'Active coding';
847+
if (level === 4) intensity = 'Very active coding';
848+
849+
const tooltipContent = \`📅 \${dateStr} (\${dayNames[dayOfWeek]})
850+
⏰ Time spent: \${hours}h \${mins}m
851+
📊 Activity level: \${intensity}\`;
852+
840853
// Set the data-level on the previous cell if it exists
841854
if (previousCell) {
842855
previousCell.setAttribute('data-level', level.toString());
843-
previousCell.title = \`\${dateStr} (\${dayNames[dayOfWeek]}): \${formatTime(minutes)}\`;
856+
previousCell.title = tooltipContent;
844857
}
845858
846859
grid.appendChild(cell);
@@ -855,8 +868,20 @@ export class SummaryViewProvider implements vscode.WebviewViewProvider {
855868
const lastLevel = getIntensityLevel(lastMinutes);
856869
const lastDayName = ['Saturday','Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'][lastDate.getDay()];
857870
871+
const lastHours = Math.floor(lastMinutes / 60);
872+
const lastMins = Math.round(lastMinutes % 60);
873+
let lastIntensity = 'No activity';
874+
if (lastLevel === 1) lastIntensity = 'Light coding';
875+
if (lastLevel === 2) lastIntensity = 'Moderate coding';
876+
if (lastLevel === 3) lastIntensity = 'Active coding';
877+
if (lastLevel === 4) lastIntensity = 'Very active coding';
878+
879+
const lastTooltipContent = \`📅 \${lastDateStr} (\${lastDayName})
880+
⏰ Time spent: \${lastHours}h \${lastMins}m
881+
📊 Activity level: \${lastIntensity}\`;
882+
858883
previousCell.setAttribute('data-level', lastLevel.toString());
859-
previousCell.title = \`\${lastDateStr} (\${lastDayName}): \${formatTime(lastMinutes)}\`;
884+
previousCell.title = lastTooltipContent;
860885
}
861886
862887
monthGrid.appendChild(grid);

0 commit comments

Comments
 (0)