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 week-over-week task comparison to QuickSummary

Adam Eivy512e1022c7c0
diff --git a/.changelog/v0.17.8.md b/.changelog/v0.17.8.md
index 328d7c2b08..41693023a8 100644
--- a/.changelog/v0.17.8.md
+++ b/.changelog/v0.17.8.md
@@ -47,6 +47,13 @@ JIRA integration improvements and token lifecycle management.
- Accounts for currently running agents (assumes half completion time remaining)
- Shows formatted time (e.g., "~15m", "~2h 30m") with hover tooltip showing data confidence
+### Week-over-week task comparison in QuickSummary
+- **Weekly comparison indicator** shows this week's task count vs last week (same number of days)
+- Displays change percentage with trend arrow (up/down/neutral)
+- Green up arrow for >10% improvement, yellow down arrow for >10% decline
+- Helps users quickly see if they're on track for the week compared to last week
+- Only appears when there's historical data from last week to compare against
+
### 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.jsx
index a70f4466ea..d1823c7c21 100644
--- a/client/src/components/cos/QuickSummary.jsx
+++ b/client/src/components/cos/QuickSummary.jsx
@@ -12,7 +12,8 @@ import {
ChevronDown,
ChevronRight,
Award,
- Hourglass
+ Hourglass,
+ Calendar
} from 'lucide-react';
import * as api from '../../services/api';
@@ -42,7 +43,7 @@ export default function QuickSummary() {
return null;
}
- const { today, streak, nextJob, queue, velocity } = summary;
+ const { today, streak, nextJob, queue, velocity, weekComparison } = summary;
// Only show if there's meaningful data to display
const hasActivity = today.completed > 0 || today.running > 0 || streak.current > 0 || queue.total > 0;
@@ -146,6 +147,38 @@ export default function QuickSummary() {
</div>
)}
+ {/* Week over Week Comparison */}
+ {weekComparison && weekComparison.lastWeek?.tasks > 0 && (
+ <div className="flex items-center gap-1.5" title={`This week: ${weekComparison.thisWeek?.tasks || 0} tasks, Last week (same days): ${weekComparison.lastWeek?.tasks} tasks`}>
+ <Calendar size={14} className={
+ weekComparison.trend === 'up' ? 'text-port-success' :
+ weekComparison.trend === 'down' ? 'text-port-warning' :
+ 'text-gray-400'
+ } />
+ <span className="text-gray-400">Week:</span>
+ <span className={`font-medium flex items-center gap-1 ${
+ weekComparison.trend === 'up' ? 'text-port-success' :
+ weekComparison.trend === 'down' ? 'text-port-warning' :
+ 'text-white'
+ }`}>
+ {weekComparison.thisWeek?.tasks || 0}
+ {weekComparison.changePercent !== null && (
+ <span className={`text-xs flex items-center ${
+ weekComparison.trend === 'up' ? 'text-port-success' :
+ weekComparison.trend === 'down' ? 'text-port-warning' :
+ 'text-gray-500'
+ }`}>
+ {weekComparison.trend === 'up' ? <TrendingUp size={10} /> :
+ weekComparison.trend === 'down' ? <TrendingDown size={10} /> :
+ <Minus size={10} />}
+ {Math.abs(weekComparison.changePercent)}%
+ </span>
+ )}
+ </span>
+ <span className="text-gray-500 text-xs">vs last</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.js
index 6817c74bfb..5a61ca0b76 100644
--- a/server/routes/cos.js
+++ b/server/routes/cos.js
@@ -1055,12 +1055,13 @@ 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 call
router.get('/quick-summary', asyncHandler(async (req, res) => {
- const [todayActivity, productivityData, tasksData, jobStats, velocityData] = await Promise.all([
+ const [todayActivity, productivityData, tasksData, jobStats, velocityData, weekData] = await Promise.all([
cos.getTodayActivity(),
productivity.getProductivitySummary(),
cos.getAllTasks(),
autonomousJobs.getJobStats(),
- productivity.getVelocityMetrics()
+ productivity.getVelocityMetrics(),
+ productivity.getWeekComparison()
]);
// Count pending approvals from system tasks
@@ -1114,7 +1115,8 @@ router.get('/quick-summary', asyncHandler(async (req, res) => {
running: todayActivity.isRunning,
paused: todayActivity.isPaused,
lastEvaluation: todayActivity.lastEvaluation
- }
+ },
+ weekComparison: weekData
});
}));
diff --git a/server/services/productivity.js b/server/services/productivity.js
index 06ef7f72ab..6c6ed22fad 100644
--- a/server/services/productivity.js
+++ b/server/services/productivity.js
@@ -420,6 +420,84 @@ export async function getProductivitySummary() {
};
}
+/**
+ * Get week-over-week comparison metrics
+ * Compares this week's completed tasks to last week
+ * @returns {Object} Week comparison data
+ */
+export async function getWeekComparison() {
+ const data = await loadProductivity();
+ const dailyHistory = data.dailyHistory || {};
+
+ // Get date ranges for this week and last week
+ const today = new Date();
+ const dayOfWeek = today.getDay(); // 0 = Sunday
+
+ // This week: from last Sunday to today
+ const thisWeekStart = new Date(today);
+ thisWeekStart.setDate(today.getDate() - dayOfWeek);
+ thisWeekStart.setHours(0, 0, 0, 0);
+
+ // Last week: 7 days before this week's start, for 7 days
+ const lastWeekStart = new Date(thisWeekStart);
+ lastWeekStart.setDate(lastWeekStart.getDate() - 7);
+
+ // Aggregate this week's tasks (up to today)
+ let thisWeekTasks = 0;
+ let thisWeekSuccesses = 0;
+ for (let d = new Date(thisWeekStart); d <= today; d.setDate(d.getDate() + 1)) {
+ const dateStr = getDateString(d);
+ const dayData = dailyHistory[dateStr];
+ if (dayData) {
+ thisWeekTasks += dayData.tasks || 0;
+ thisWeekSuccesses += dayData.successes || 0;
+ }
+ }
+
+ // Aggregate last week's tasks (same day range as this week for fair comparison)
+ let lastWeekTasks = 0;
+ let lastWeekSuccesses = 0;
+ const lastWeekEnd = new Date(lastWeekStart);
+ lastWeekEnd.setDate(lastWeekEnd.getDate() + dayOfWeek); // Same relative day as today
+ for (let d = new Date(lastWeekStart); d <= lastWeekEnd; d.setDate(d.getDate() + 1)) {
+ const dateStr = getDateString(d);
+ const dayData = dailyHistory[dateStr];
+ if (dayData) {
+ lastWeekTasks += dayData.tasks || 0;
+ lastWeekSuccesses += dayData.successes || 0;
+ }
+ }
+
+ // Calculate change
+ let changePercent = null;
+ let trend = 'neutral';
+ if (lastWeekTasks > 0) {
+ changePercent = Math.round(((thisWeekTasks - lastWeekTasks) / lastWeekTasks) * 100);
+ if (changePercent > 10) trend = 'up';
+ else if (changePercent < -10) trend = 'down';
+ } else if (thisWeekTasks > 0) {
+ // No tasks last week but have tasks this week
+ trend = 'up';
+ changePercent = 100;
+ }
+
+ return {
+ thisWeek: {
+ tasks: thisWeekTasks,
+ successes: thisWeekSuccesses,
+ successRate: thisWeekTasks > 0 ? Math.round((thisWeekSuccesses / thisWeekTasks) * 100) : 0
+ },
+ lastWeek: {
+ tasks: lastWeekTasks,
+ successes: lastWeekSuccesses,
+ successRate: lastWeekTasks > 0 ? Math.round((lastWeekSuccesses / lastWeekTasks) * 100) : 0
+ },
+ changePercent,
+ trend,
+ daysCompared: dayOfWeek + 1 // How many days we're comparing (e.g., if today is Tuesday, comparing 3 days)
+ };
+}
+
/**
* Get velocity metrics - how today compares to historical average
* @returns {Object} Velocity data including today's count, average, and relative performance