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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
feat: add task velocity indicator to QuickSummary
Adam Eivy886692e3c6e9
diff --git a/.changelog/v0.17.8.md b/.changelog/v0.17.8.mdindex 538c01b7b0..188f66961d 100644--- a/.changelog/v0.17.8.md+++ b/.changelog/v0.17.8.md@@ -27,6 +27,13 @@ JIRA integration improvements and token lifecycle management.## Improvements+### Task velocity indicator in QuickSummary+- **Pace indicator** shows how today's task completion compares to your personal historical average+- Displays percentage (e.g., "120% vs avg") with color-coded visual feedback+- Labels: exceptional (150%+), above-average (120%+), on-track (80%+), slow/light (<80%)+- Only appears after 3+ days of historical data to ensure meaningful comparisons+- Helps users quickly gauge if they're having a productive day relative to their norm+### Enhanced learning-based model selection- Model selection now uses the full routing accuracy data from task learning- Supports tier-specific recommendations (not just upgrades to heavy)diff --git a/client/src/components/cos/QuickSummary.jsx b/client/src/components/cos/QuickSummary.jsxindex 2710cd32f8..09ece169da 100644--- a/client/src/components/cos/QuickSummary.jsx+++ b/client/src/components/cos/QuickSummary.jsx@@ -7,7 +7,10 @@ import {ListTodo,Zap,AlertCircle,- Timer+ Timer,+ TrendingUp,+ TrendingDown,+ Minus} from 'lucide-react';import * as api from '../../services/api';@@ -36,7 +39,7 @@ export default function QuickSummary() {return null;}- const { today, streak, nextJob, queue } = summary;+ const { today, streak, nextJob, queue, velocity } = summary;// Only show if there's meaningful data to displayconst hasActivity = today.completed > 0 || today.running > 0 || streak.current > 0 || queue.total > 0;@@ -44,6 +47,38 @@ export default function QuickSummary() {return null;}+ // Velocity indicator helper+ const getVelocityDisplay = () => {+ if (!velocity?.percentage || velocity.historicalDays < 3) return null;++ const { percentage, label } = velocity;+ let icon = Minus;+ let color = 'text-gray-400';+ let bgColor = 'bg-gray-500/10';++ if (label === 'exceptional') {+ icon = TrendingUp;+ color = 'text-emerald-400';+ bgColor = 'bg-emerald-500/20';+ } else if (label === 'above-average') {+ icon = TrendingUp;+ color = 'text-port-success';+ bgColor = 'bg-port-success/15';+ } else if (label === 'on-track') {+ icon = Minus;+ color = 'text-port-accent';+ bgColor = 'bg-port-accent/15';+ } else if (label === 'slow' || label === 'light') {+ icon = TrendingDown;+ color = 'text-port-warning';+ bgColor = 'bg-port-warning/15';+ }++ return { icon, color, bgColor, percentage };+ };++ const velocityDisplay = getVelocityDisplay();+// Format time until next jobconst formatTimeUntil = (isoDate) => {if (!isoDate) return null;@@ -96,6 +131,18 @@ export default function QuickSummary() {</div>)}+ {/* Velocity */}+ {velocityDisplay && (+ <div className="flex items-center gap-1.5">+ <velocityDisplay.icon size={14} className={velocityDisplay.color} />+ <span className="text-gray-400">Pace:</span>+ <span className={`font-medium ${velocityDisplay.color} px-1.5 py-0.5 rounded ${velocityDisplay.bgColor}`}>+ {velocityDisplay.percentage}%+ </span>+ <span className="text-gray-500 text-xs">vs avg</span>+ </div>+ )}+{/* Pending Work */}{queue.total > 0 && (<div className="flex items-center gap-1.5">diff --git a/server/routes/cos.js b/server/routes/cos.jsindex 970a31371b..f8a1e68e69 100644--- a/server/routes/cos.js+++ b/server/routes/cos.js@@ -1055,11 +1055,12 @@ router.get('/recent-tasks', asyncHandler(async (req, res) => {// GET /api/cos/quick-summary - Get at-a-glance dashboard summary// Combines today's activity, streak status, next job, and pending approvals into one efficient callrouter.get('/quick-summary', asyncHandler(async (req, res) => {- const [todayActivity, productivityData, tasksData, jobStats] = await Promise.all([+ const [todayActivity, productivityData, tasksData, jobStats, velocityData] = await Promise.all([cos.getTodayActivity(),productivity.getProductivitySummary(),cos.getAllTasks(),- autonomousJobs.getJobStats()+ autonomousJobs.getJobStats(),+ productivity.getVelocityMetrics()]);// Count pending approvals from system tasks@@ -1083,6 +1084,12 @@ router.get('/quick-summary', asyncHandler(async (req, res) => {weekly: productivityData.weeklyStreak,lastActive: productivityData.lastActive},+ velocity: {+ percentage: velocityData.velocity,+ label: velocityData.velocityLabel,+ avgPerDay: velocityData.avgPerDay,+ historicalDays: velocityData.historicalDays+ },nextJob: jobStats.nextDue,queue: {pendingApprovals,diff --git a/server/services/productivity.js b/server/services/productivity.jsindex f85de26540..06ef7f72ab 100644--- a/server/services/productivity.js+++ b/server/services/productivity.js@@ -420,6 +420,58 @@ export async function getProductivitySummary() {};}+/**+ * Get velocity metrics - how today compares to historical average+ * @returns {Object} Velocity data including today's count, average, and relative performance+ */+export async function getVelocityMetrics() {+ const data = await loadProductivity();+ const dailyHistory = data.dailyHistory || {};+ const today = getDateString();++ // Get today's stats+ const todayStats = dailyHistory[today] || { tasks: 0, successes: 0, failures: 0 };++ // Calculate historical daily average (excluding today)+ const historicalDays = Object.entries(dailyHistory)+ .filter(([date]) => date !== today)+ .map(([, stats]) => stats);++ // Only count days with at least 1 task for average (active days)+ const activeDays = historicalDays.filter(d => d.tasks > 0);+ const avgTasksPerDay = activeDays.length > 0+ ? activeDays.reduce((sum, d) => sum + d.tasks, 0) / activeDays.length+ : 0;++ // Calculate velocity: how today compares to average+ // null if no history, percentage otherwise+ let velocity = null;+ let velocityLabel = null;++ if (avgTasksPerDay > 0 && todayStats.tasks > 0) {+ velocity = Math.round((todayStats.tasks / avgTasksPerDay) * 100);+ if (velocity >= 150) velocityLabel = 'exceptional';+ else if (velocity >= 120) velocityLabel = 'above-average';+ else if (velocity >= 80) velocityLabel = 'on-track';+ else if (velocity >= 50) velocityLabel = 'slow';+ else velocityLabel = 'light';+ } else if (todayStats.tasks > 0 && avgTasksPerDay === 0) {+ // First active day ever+ velocity = 100;+ velocityLabel = 'first-day';+ }++ return {+ today: todayStats.tasks,+ todaySuccesses: todayStats.successes,+ todayFailures: todayStats.failures,+ avgPerDay: Math.round(avgTasksPerDay * 10) / 10,+ historicalDays: activeDays.length,+ velocity,+ velocityLabel+ };+}+/*** Get daily task trends for visualization* Returns last N days of task completion data with trend analysis