Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

feat: add hourly activity heatmap to Dashboard

Adam Eivyac0b7df59fbd
diff --git a/.changelog/v0.9.x.md b/.changelog/v0.9.x.md
index 767641349e..2377bce6c1 100644
--- a/.changelog/v0.9.x.md
+++ b/.changelog/v0.9.x.md
@@ -60,6 +60,14 @@
- Double-click folders to select or use "Select Current" button
- "Parent" and "Default" navigation buttons for easy directory traversal
+### Dashboard Activity Visualization
+- **Hourly Activity Heatmap**: New visualization showing session distribution across all 24 hours
+ - GitHub-style contribution graph with 5-level intensity colors
+ - Identifies peak productivity hours with session counts
+ - Responsive design with condensed hour labels on mobile
+ - Fully accessible with ARIA labels and hover tooltips
+ - Displays total sessions tracked for context
+
## 🔧 Improvements
### Architecture
diff --git a/client/src/pages/Dashboard.jsx b/client/src/pages/Dashboard.jsx
index 169eff1ad2..49707a68e5 100644
--- a/client/src/pages/Dashboard.jsx
+++ b/client/src/pages/Dashboard.jsx
@@ -174,6 +174,11 @@ export default function Dashboard() {
/>
</div>
)}
+
+ {/* Hourly Activity Heatmap */}
+ {usage?.hourlyActivity && (
+ <HourlyActivityHeatmap hourlyActivity={usage.hourlyActivity} />
+ )}
</div>
);
}
@@ -189,3 +194,104 @@ function StatCard({ label, value, icon }) {
</div>
);
}
+
+function HourlyActivityHeatmap({ hourlyActivity }) {
+ const maxActivity = Math.max(...hourlyActivity, 1);
+
+ // Find peak hour(s)
+ const peakValue = Math.max(...hourlyActivity);
+ const peakHours = hourlyActivity
+ .map((val, idx) => ({ hour: idx, count: val }))
+ .filter(h => h.count === peakValue && h.count > 0);
+
+ // Calculate total sessions
+ const totalSessions = hourlyActivity.reduce((sum, val) => sum + val, 0);
+
+ // Format hour label (12-hour format)
+ const formatHour = (hour) => {
+ if (hour === 0) return '12a';
+ if (hour === 12) return '12p';
+ return hour < 12 ? `${hour}a` : `${hour - 12}p`;
+ };
+
+ // Get intensity class based on activity level
+ const getIntensityClass = (count) => {
+ if (count === 0) return 'bg-port-border/30';
+ const intensity = count / maxActivity;
+ if (intensity >= 0.8) return 'bg-port-success';
+ if (intensity >= 0.5) return 'bg-port-success/70';
+ if (intensity >= 0.25) return 'bg-port-success/40';
+ return 'bg-port-success/20';
+ };
+
+ // Determine peak time description
+ const getPeakTimeDescription = () => {
+ if (peakHours.length === 0 || peakValue === 0) return null;
+ if (peakHours.length === 1) {
+ const hour = peakHours[0].hour;
+ return `Peak: ${formatHour(hour)} (${peakValue} sessions)`;
+ }
+ const hours = peakHours.slice(0, 3).map(h => formatHour(h.hour)).join(', ');
+ return `Peak hours: ${hours} (${peakValue} sessions each)`;
+ };
+
+ if (totalSessions === 0) return null;
+
+ return (
+ <div className="mt-8 bg-port-card border border-port-border rounded-xl p-6">
+ <div className="flex flex-col sm:flex-row sm:items-center justify-between gap-2 mb-4">
+ <div className="flex items-center gap-3">
+ <div className="text-2xl" aria-hidden="true">⏰</div>
+ <div>
+ <h3 className="text-lg font-semibold text-white">Activity by Hour</h3>
+ <p className="text-sm text-gray-500">{totalSessions} total sessions tracked</p>
+ </div>
+ </div>
+ {getPeakTimeDescription() && (
+ <div className="text-sm text-port-success">
+ {getPeakTimeDescription()}
+ </div>
+ )}
+ </div>
+
+ {/* Heatmap grid */}
+ <div className="grid grid-cols-12 gap-1" role="img" aria-label="Hourly activity heatmap">
+ {hourlyActivity.map((count, hour) => (
+ <div
+ key={hour}
+ className={`aspect-square rounded-sm ${getIntensityClass(count)} transition-colors cursor-default`}
+ title={`${formatHour(hour)}: ${count} session${count !== 1 ? 's' : ''}`}
+ aria-label={`${formatHour(hour)}: ${count} sessions`}
+ />
+ ))}
+ </div>
+
+ {/* Hour labels - show key hours on mobile, all on desktop */}
+ <div className="mt-2 grid grid-cols-12 gap-1 text-xs text-gray-500">
+ {hourlyActivity.map((_, hour) => (
+ <div
+ key={hour}
+ className={`text-center ${
+ hour % 6 === 0 ? 'block' : 'hidden sm:block'
+ }`}
+ >
+ {hour % 3 === 0 ? formatHour(hour) : ''}
+ </div>
+ ))}
+ </div>
+
+ {/* Legend */}
+ <div className="mt-4 flex items-center justify-end gap-2 text-xs text-gray-500">
+ <span>Less</span>
+ <div className="flex gap-0.5">
+ <div className="w-3 h-3 rounded-sm bg-port-border/30" />
+ <div className="w-3 h-3 rounded-sm bg-port-success/20" />
+ <div className="w-3 h-3 rounded-sm bg-port-success/40" />
+ <div className="w-3 h-3 rounded-sm bg-port-success/70" />
+ <div className="w-3 h-3 rounded-sm bg-port-success" />
+ </div>
+ <span>More</span>
+ </div>
+ </div>
+ );
+}