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(dashboard): add recent tasks panel to CoS widget
Adam Eivy02b52419bd13
diff --git a/.changelog/v0.12.x.md b/.changelog/v0.12.x.mdindex 8debfe4e88..62acbbbf38 100644--- a/.changelog/v0.12.x.md+++ b/.changelog/v0.12.x.md@@ -434,6 +434,22 @@ This release adds branch management and automated release workflow capabilities- `client/src/components/CosDashboardWidget.jsx` — New widget component with 4-stat grid (Today, Streak, Pending, Learning), leverages existing `getCosQuickSummary()` and `getCosLearningSummary()` APIs- `client/src/pages/Dashboard.jsx` — Imported and rendered CosDashboardWidget above the app grid+### Dashboard — Recent Tasks Panel+- **Recent task history**: Collapsible panel in the Dashboard CoS widget showing the 5 most recent completed tasks across all days+- **At-a-glance indicators**: When collapsed, shows a row of color-coded dots (green=success, red=failed) for quick pattern recognition+- **Expanded details**: When expanded, shows each task with description, type, app name, duration, and relative time (e.g., "2h ago", "yesterday")+- **Success/fail breakdown**: Header shows ratio of succeeded to total tasks (e.g., "3/5 succeeded")+- **Quick navigation**: Clicking any task row navigates to the Agents tab for detailed output review+- **Relative timestamps**: Shows human-friendly relative times ("just now", "2h ago", "yesterday", "Feb 8") instead of absolute timestamps++**Server changes**:+- `server/services/cos.js` — Added `getRecentTasks(limit)` function that returns completed tasks sorted by completion time with formatted durations and relative timestamps+- `server/routes/cos.js` — Added `GET /api/cos/recent-tasks` endpoint with optional `?limit=N` query parameter++**Client changes**:+- `client/src/services/api.js` — Added `getCosRecentTasks(limit)` API function+- `client/src/components/CosDashboardWidget.jsx` — Added collapsible Recent Tasks section with expanded/collapsed states, task list with status icons, and summary dot indicators+### CyberCity — Billboard Text Fix & Visual Polish- **Fixed mirrored billboard text**: All holographic billboards and neon street signs had text facing inward toward city center, causing mirrored/backward text when viewed from the default camera position outside the city. Flipped rotations to face outward and added solid back-blocker planes to prevent text bleed-through from any viewing angle- **Bloom post-processing**: Added `@react-three/postprocessing` with subtle bloom effect (intensity 0.8, luminance threshold 0.3) that makes all neon elements, emissive materials, and light sources glow realistically — the single biggest visual upgrade for the cyberpunk aestheticdiff --git a/client/src/components/CosDashboardWidget.jsx b/client/src/components/CosDashboardWidget.jsxindex d24a4fdacf..17f51b6594 100644--- a/client/src/components/CosDashboardWidget.jsx+++ b/client/src/components/CosDashboardWidget.jsx@@ -7,28 +7,35 @@ import {Brain,AlertCircle,ChevronRight,+ ChevronDown,Zap,- Bot+ Bot,+ XCircle,+ History} from 'lucide-react';import * as api from '../services/api';/*** CosDashboardWidget - Compact CoS status widget for the main Dashboard- * Shows today's progress, streak status, learning health, and CoS running state+ * Shows today's progress, streak status, learning health, CoS running state, and recent tasks*/const CosDashboardWidget = memo(function CosDashboardWidget() {const [summary, setSummary] = useState(null);const [learningSummary, setLearningSummary] = useState(null);+ const [recentTasks, setRecentTasks] = useState(null);const [loading, setLoading] = useState(true);+ const [tasksExpanded, setTasksExpanded] = useState(false);useEffect(() => {const loadData = async () => {- const [quickData, learningData] = await Promise.all([+ const [quickData, learningData, tasksData] = await Promise.all([api.getCosQuickSummary().catch(() => null),- api.getCosLearningSummary().catch(() => null)+ api.getCosLearningSummary().catch(() => null),+ api.getCosRecentTasks(5).catch(() => null)]);setSummary(quickData);setLearningSummary(learningData);+ setRecentTasks(tasksData);setLoading(false);};@@ -176,6 +183,76 @@ const CosDashboardWidget = memo(function CosDashboardWidget() {)}</Link></div>++ {/* Recent Tasks Section */}+ {recentTasks?.tasks?.length > 0 && (+ <div className="mt-4 pt-4 border-t border-port-border">+ <button+ onClick={() => setTasksExpanded(!tasksExpanded)}+ className="flex items-center justify-between w-full text-left mb-2 group"+ >+ <div className="flex items-center gap-2">+ <History size={14} className="text-gray-400" />+ <span className="text-sm font-medium text-gray-300">Recent Tasks</span>+ <span className="text-xs text-gray-500">+ ({recentTasks.summary.succeeded}/{recentTasks.summary.total} succeeded)+ </span>+ </div>+ <ChevronDown+ size={16}+ className={`text-gray-400 transition-transform ${tasksExpanded ? 'rotate-180' : ''}`}+ />+ </button>++ {tasksExpanded && (+ <div className="space-y-2">+ {recentTasks.tasks.map((task) => (+ <Link+ key={task.id}+ to={`/cos/agents`}+ className="flex items-start gap-2 p-2 bg-port-bg/30 rounded-lg hover:bg-port-bg/50 transition-colors"+ >+ {task.success ? (+ <CheckCircle size={14} className="text-port-success mt-0.5 shrink-0" />+ ) : (+ <XCircle size={14} className="text-port-error mt-0.5 shrink-0" />+ )}+ <div className="flex-1 min-w-0">+ <div className="text-sm text-gray-300 truncate">+ {task.description}+ </div>+ <div className="flex items-center gap-2 text-xs text-gray-500">+ <span className="capitalize">{task.taskType.replace(/-/g, ' ')}</span>+ {task.app && (+ <>+ <span>•</span>+ <span>{task.app}</span>+ </>+ )}+ <span>•</span>+ <span>{task.durationFormatted}</span>+ <span>•</span>+ <span>{task.completedRelative}</span>+ </div>+ </div>+ </Link>+ ))}+ </div>+ )}++ {!tasksExpanded && (+ <div className="flex gap-1">+ {recentTasks.tasks.slice(0, 5).map((task) => (+ <div+ key={task.id}+ className={`w-2 h-2 rounded-full ${task.success ? 'bg-port-success' : 'bg-port-error'}`}+ title={`${task.description.substring(0, 50)}... (${task.completedRelative})`}+ />+ ))}+ </div>+ )}+ </div>+ )}</div>);});diff --git a/client/src/services/api.js b/client/src/services/api.jsindex 5f437b7be0..f91e9d0945 100644--- a/client/src/services/api.js+++ b/client/src/services/api.js@@ -532,6 +532,7 @@ export const getCosProductivity = () => request('/cos/productivity');export const getCosProductivitySummary = () => request('/cos/productivity/summary');export const recalculateCosProductivity = () => request('/cos/productivity/recalculate', { method: 'POST' });export const getCosQuickSummary = () => request('/cos/quick-summary');+export const getCosRecentTasks = (limit = 10) => request(`/cos/recent-tasks?limit=${limit}`);export const getCosActionableInsights = () => request('/cos/actionable-insights');// Task Schedule (Configurable Intervals)diff --git a/server/routes/cos.js b/server/routes/cos.jsindex 8aa6961346..737d1d286e 100644--- a/server/routes/cos.js+++ b/server/routes/cos.js@@ -997,6 +997,13 @@ router.get('/actionable-insights', asyncHandler(async (req, res) => {});}));+// GET /api/cos/recent-tasks - Get recent completed tasks for dashboard widget+router.get('/recent-tasks', asyncHandler(async (req, res) => {+ const limit = parseInt(req.query.limit, 10) || 10;+ const recentTasks = await cos.getRecentTasks(limit);+ res.json(recentTasks);+}));+// 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) => {diff --git a/server/services/cos.js b/server/services/cos.jsindex 56472994d2..218c552c38 100644--- a/server/services/cos.js+++ b/server/services/cos.js@@ -2534,6 +2534,71 @@ export async function getTodayActivity() {};}+/**+ * Get recent completed tasks across all days+ * @param {number} limit - Maximum number of tasks to return (default: 10)+ * @returns {Object} Recent tasks with metadata+ */+export async function getRecentTasks(limit = 10) {+ const state = await loadState();++ // Get all completed agents, sorted by completion time (newest first)+ const completedAgents = Object.values(state.agents)+ .filter(a => a.status === 'completed' && a.completedAt)+ .sort((a, b) => new Date(b.completedAt) - new Date(a.completedAt))+ .slice(0, limit);++ // Transform to compact task summaries+ const tasks = completedAgents.map(a => ({+ id: a.id,+ taskId: a.taskId,+ description: a.metadata?.taskDescription?.substring(0, 120) || a.taskId,+ taskType: a.metadata?.analysisType || a.metadata?.taskType || 'task',+ app: a.metadata?.app || null,+ success: a.result?.success || false,+ duration: a.result?.duration || 0,+ durationFormatted: formatDuration(a.result?.duration || 0),+ completedAt: a.completedAt,+ // Add relative time (e.g., "2h ago", "yesterday")+ completedRelative: formatRelativeTime(a.completedAt)+ }));++ // Calculate summary stats+ const successCount = tasks.filter(t => t.success).length;+ const failCount = tasks.filter(t => !t.success).length;++ return {+ tasks,+ summary: {+ total: tasks.length,+ succeeded: successCount,+ failed: failCount,+ successRate: tasks.length > 0 ? Math.round((successCount / tasks.length) * 100) : 0+ }+ };+}++/**+ * Format a timestamp as relative time (e.g., "2h ago", "yesterday")+ * @param {string} timestamp - ISO timestamp+ * @returns {string} Relative time string+ */+function formatRelativeTime(timestamp) {+ const now = new Date();+ const then = new Date(timestamp);+ const diffMs = now - then;+ const diffMins = Math.floor(diffMs / 60000);+ const diffHours = Math.floor(diffMs / 3600000);+ const diffDays = Math.floor(diffMs / 86400000);++ if (diffMins < 1) return 'just now';+ if (diffMins < 60) return `${diffMins}m ago`;+ if (diffHours < 24) return `${diffHours}h ago`;+ if (diffDays === 1) return 'yesterday';+ if (diffDays < 7) return `${diffDays}d ago`;+ return then.toLocaleDateString('en-US', { month: 'short', day: 'numeric' });+}+/*** Clear completed agents from state (keep in files)*/