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

fix: name recent-task outcomes in the dashboard CoS widget, not colour alone

[._.]/ Adam Eivy73a3db61868b
diff --git a/client/src/components/CosDashboardWidget.jsx b/client/src/components/CosDashboardWidget.jsx
index d0efa967ab..e2c52e0ab1 100644
--- a/client/src/components/CosDashboardWidget.jsx
+++ b/client/src/components/CosDashboardWidget.jsx
@@ -1,4 +1,4 @@
-import { useState, memo } from 'react';
+import { useState, useId, memo } from 'react';
import { Link } from 'react-router';
import {
CheckCircle,
@@ -130,6 +130,7 @@ const CosDashboardWidget = memo(function CosDashboardWidget() {
const { summary, learningSummary, recentTasks, activityCalendar } = dashData ?? {};
const [tasksExpanded, setTasksExpanded] = useState(false);
+ const recentTasksId = useId();
// Tick every minute so the client-side `timeAgo(task.completedAt)` labels
// recompute against the latest wall-clock time across unchanged snapshots.
useTimeTick(60000);
@@ -263,7 +264,10 @@ const CosDashboardWidget = memo(function CosDashboardWidget() {
{recentTasks?.tasks?.length > 0 && (
<div className="mt-4 pt-4 border-t border-port-border">
<button
+ type="button"
onClick={() => setTasksExpanded(!tasksExpanded)}
+ aria-expanded={tasksExpanded}
+ aria-controls={recentTasksId}
className="flex items-center justify-between w-full text-left mb-2 group"
>
<div className="flex items-center gap-2">
@@ -279,8 +283,11 @@ const CosDashboardWidget = memo(function CosDashboardWidget() {
/>
</button>
- {tasksExpanded && (
- <div className="space-y-2">
+ {/* Outcome is never colour alone: each row carries a glyph that differs
+ by outcome plus a visually-hidden word, so colour-blind and
+ screen-reader users get the same success/failure signal (#12035). */}
+ {tasksExpanded ? (
+ <div id={recentTasksId} className="space-y-2">
{recentTasks.tasks.map((task) => (
<Link
key={task.id}
@@ -288,10 +295,11 @@ const CosDashboardWidget = memo(function CosDashboardWidget() {
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" />
+ <CheckCircle size={14} aria-hidden="true" className="text-port-success mt-0.5 shrink-0" />
) : (
- <XCircle size={14} className="text-port-error mt-0.5 shrink-0" />
+ <XCircle size={14} aria-hidden="true" className="text-port-error mt-0.5 shrink-0" />
)}
+ <span className="sr-only">{task.success ? 'succeeded' : 'failed'}:</span>
<div className="flex-1 min-w-0">
<div className="text-sm text-gray-300 truncate">
{task.description}
@@ -319,18 +327,23 @@ const CosDashboardWidget = memo(function CosDashboardWidget() {
</Link>
))}
</div>
- )}
-
- {!tasksExpanded && (
- <div className="flex gap-1">
+ ) : (
+ <ul id={recentTasksId} className="flex gap-1 list-none p-0 m-0">
{recentTasks.tasks.slice(0, 5).map((task) => (
- <div
+ <li
key={task.id}
- className={`w-2 h-2 rounded-full ${task.success ? 'bg-port-success' : 'bg-port-error'}`}
+ className="flex"
title={`${task.description.substring(0, 50)}... (${timeAgo(task.completedAt)})`}
- />
+ >
+ {task.success ? (
+ <CheckCircle size={12} aria-hidden="true" className="text-port-success" />
+ ) : (
+ <XCircle size={12} aria-hidden="true" className="text-port-error" />
+ )}
+ <span className="sr-only">{task.description}: {task.success ? 'succeeded' : 'failed'}</span>
+ </li>
))}
- </div>
+ </ul>
)}
</div>
)}
diff --git a/client/src/components/CosDashboardWidget.test.jsx b/client/src/components/CosDashboardWidget.test.jsx
new file mode 100644
index 0000000000..797dfdda0b
--- /dev/null
+++ b/client/src/components/CosDashboardWidget.test.jsx
@@ -0,0 +1,66 @@
+import { MemoryRouter } from 'react-router';
+import { fireEvent, render, screen, within } from '@testing-library/react';
+import { beforeEach, describe, expect, it, vi } from 'vitest';
+
+// The widget's own contract is what it renders from a snapshot; the
+// subscription/retry mechanics belong to useSocketResource's suite. Mocking
+// the hook pins the render against a fixed { data, loading } pair.
+const { mockUseSocketResource } = vi.hoisted(() => ({ mockUseSocketResource: vi.fn() }));
+
+vi.mock('../hooks/useSocketResource', () => ({
+ useSocketResource: (...args) => mockUseSocketResource(...args),
+}));
+
+vi.mock('../services/api', () => ({
+ getCosQuickSummary: vi.fn(),
+ getCosLearningSummary: vi.fn(),
+ getCosRecentTasks: vi.fn(),
+ getCosActivityCalendar: vi.fn(),
+}));
+
+import CosDashboardWidget from './CosDashboardWidget.jsx';
+
+const snapshot = {
+ summary: {
+ today: { completed: 2, succeeded: 1, failed: 1, running: 0, timeWorked: '12m' },
+ queue: { total: 0, pendingApprovals: 0 },
+ status: { running: true, paused: false, lastEvaluation: '2026-07-13T10:00:00.000Z' },
+ },
+ learningSummary: { status: 'good', overallSuccessRate: 50, skipped: 0, totalCompleted: 2 },
+ recentTasks: {
+ tasks: [
+ { id: 'a', description: 'Example docs sweep', taskType: 'documentation', app: null, durationFormatted: '5m', success: true, completedAt: '2026-07-13T09:50:00.000Z', completedRelative: '10m ago' },
+ { id: 'b', description: 'Example security audit', taskType: 'security', app: null, durationFormatted: '7m', success: false, completedAt: '2026-07-13T09:40:00.000Z', completedRelative: '20m ago' },
+ ],
+ summary: { total: 2, succeeded: 1 },
+ },
+ activityCalendar: { weeks: [], maxTasks: 1, summary: { totalTasks: 0, activeDays: 0, avgTasksPerActiveDay: 0 } },
+};
+
+const renderWidget = () => render(<MemoryRouter><CosDashboardWidget /></MemoryRouter>);
+
+beforeEach(() => {
+ vi.clearAllMocks();
+ mockUseSocketResource.mockReturnValue({ data: snapshot, loading: false, error: null });
+});
+
+describe('CosDashboardWidget recent-task outcomes', () => {
+ it('names each outcome in text and exposes the expander state', () => {
+ renderWidget();
+
+ const toggle = screen.getByRole('button', { name: /Recent Tasks/ });
+ expect(toggle).toHaveAttribute('aria-expanded', 'false');
+ const collapsed = document.getElementById(toggle.getAttribute('aria-controls'));
+ const rows = within(collapsed).getAllByRole('listitem');
+ expect(rows).toHaveLength(2);
+ expect(rows[0]).toHaveTextContent('Example docs sweep: succeeded');
+ expect(rows[1]).toHaveTextContent('Example security audit: failed');
+
+ fireEvent.click(toggle);
+ expect(toggle).toHaveAttribute('aria-expanded', 'true');
+ const expanded = document.getElementById(toggle.getAttribute('aria-controls'));
+ const links = within(expanded).getAllByRole('link');
+ expect(links[0]).toHaveAccessibleName(/succeeded/);
+ expect(links[1]).toHaveAccessibleName(/failed/);
+ });
+});