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
fix: expose accessible progress meters (#9846)
Adam Eivy4275d806685c
diff --git a/client/src/components/gsd/GsdProjectHeader.jsx b/client/src/components/gsd/GsdProjectHeader.jsxindex 1aa34b867a..9ce0898e9e 100644--- a/client/src/components/gsd/GsdProjectHeader.jsx+++ b/client/src/components/gsd/GsdProjectHeader.jsx@@ -3,6 +3,7 @@ import toast from '../ui/Toast';import { RefreshCw, Terminal, Play, Settings } from 'lucide-react';import * as api from '../../services/api';import { useInstanceFeatures } from '../../hooks/useInstanceFeatures.js';+import ProgressBar from '../ui/ProgressBar.jsx';const STATUS_COLORS = {active: 'bg-port-accent text-port-accent',@@ -64,24 +65,22 @@ export default function GsdProjectHeader({ project, appId, repoPath, onRefresh }<span>Phases</span><span>{completedPhases}/{phases.length}</span></div>- <div className="h-1.5 bg-port-bg rounded-full overflow-hidden">- <div- className="h-full bg-port-success rounded-full transition-all"- style={{ width: phases.length ? `${(completedPhases / phases.length) * 100}%` : '0%' }}- />- </div>+ <ProgressBar+ percent={phases.length ? (completedPhases / phases.length) * 100 : 0}+ tone="success"+ label="Completed phases"+ /></div><div><div className="flex justify-between text-xs text-gray-500 mb-1"><span>Planned</span><span>{phasesWithPlans}/{phases.length}</span></div>- <div className="h-1.5 bg-port-bg rounded-full overflow-hidden">- <div- className="h-full bg-port-accent rounded-full transition-all"- style={{ width: phases.length ? `${(phasesWithPlans / phases.length) * 100}%` : '0%' }}- />- </div>+ <ProgressBar+ percent={phases.length ? (phasesWithPlans / phases.length) * 100 : 0}+ tone="accent"+ label="Planned phases"+ /></div></div>diff --git a/client/src/components/gsd/GsdProjectHeader.test.jsx b/client/src/components/gsd/GsdProjectHeader.test.jsxnew file mode 100644index 0000000000..3b6e145749--- /dev/null+++ b/client/src/components/gsd/GsdProjectHeader.test.jsx@@ -0,0 +1,30 @@+import { describe, expect, it, vi } from 'vitest';+import { render, screen } from '@testing-library/react';++vi.mock('react-router', () => ({ useNavigate: () => vi.fn() }));+vi.mock('../../hooks/useInstanceFeatures.js', () => ({+ useInstanceFeatures: () => ({ isFeatureEnabled: () => false }),+}));+vi.mock('../ui/Toast', () => ({ default: { success: vi.fn() } }));++import GsdProjectHeader from './GsdProjectHeader.jsx';++describe('GsdProjectHeader phase meters', () => {+ it('announces completed and planned phase percentages', () => {+ render(+ <GsdProjectHeader+ appId="example-app"+ project={{+ phases: [+ { totalTasks: 2, completedTasks: 2, verification: { status: 'passed' }, plans: [{}] },+ { totalTasks: 2, completedTasks: 1, verification: { status: 'pending' }, plans: [] },+ ],+ }}+ onRefresh={() => {}}+ />,+ );++ expect(screen.getByRole('progressbar', { name: 'Completed phases' })).toHaveAttribute('aria-valuenow', '50');+ expect(screen.getByRole('progressbar', { name: 'Planned phases' })).toHaveAttribute('aria-valuenow', '50');+ });+});diff --git a/client/src/components/system-resources/StoragePanel.jsx b/client/src/components/system-resources/StoragePanel.jsxindex cc1101b99c..e2666b023a 100644--- a/client/src/components/system-resources/StoragePanel.jsx+++ b/client/src/components/system-resources/StoragePanel.jsx@@ -8,6 +8,7 @@ import useProviderModels from '../../hooks/useProviderModels.js';import { formatBytes, formatDateTime } from '../../utils/formatters.js';import * as api from '../../services/api.js';import toast from '../ui/Toast.jsx';+import ProgressBar from '../ui/ProgressBar.jsx';const RISK_STYLE = {low: 'bg-port-success/10 text-port-success',@@ -87,7 +88,7 @@ function Metric({ label, value, tone = 'text-white', className = '' }) {}function StorageAreas({ areas }) {- const max = Math.max(1, ...(areas || []).map((area) => area.sizeBytes || 0));+ const max = Math.max(1, ...(areas || []).map((area) => Number.isFinite(area.sizeBytes) ? area.sizeBytes : 0));return (<section className="rounded-2xl border border-port-border bg-port-card p-4 sm:p-5"><div className="mb-4 flex items-center gap-2">@@ -107,12 +108,17 @@ function StorageAreas({ areas }) {</div><div className="shrink-0 text-sm font-semibold tabular-nums text-white">{storageSize(area.sizeBytes)}</div></div>- <div className="mt-2 h-1.5 overflow-hidden rounded-full bg-port-border/60">- <div- className="h-full rounded-full bg-gradient-to-r from-port-accent to-cyan-400"- style={{ width: area.status === 'unavailable' ? '0%' : `${Math.max(1, ((area.sizeBytes || 0) / max) * 100)}%` }}- />- </div>+ <ProgressBar+ className="mt-2"+ track="borderMuted"+ fillClassName="bg-gradient-to-r from-port-accent to-cyan-400"+ percent={area.status === 'unavailable' || !Number.isFinite(area.sizeBytes)+ ? null+ : (area.sizeBytes / max) * 100}+ indeterminateAnimation={false}+ label={`${area.label} storage area size relative to largest known area`}+ valueText={area.status === 'unavailable' || !Number.isFinite(area.sizeBytes) ? 'Unavailable' : undefined}+ />{area.managePath && (<Link to={area.managePath} className="mt-2 inline-block text-xs text-port-accent hover:text-port-accent/80">Manage {area.label.toLowerCase()} →diff --git a/client/src/components/system-resources/StoragePanel.test.jsx b/client/src/components/system-resources/StoragePanel.test.jsxindex 649359fcf9..9525c3f295 100644--- a/client/src/components/system-resources/StoragePanel.test.jsx+++ b/client/src/components/system-resources/StoragePanel.test.jsx@@ -105,3 +105,34 @@ describe('StoragePanel AI triage freshness', () => {expect(screen.queryByText('Obsolete advice.')).not.toBeInTheDocument();});});++describe('StoragePanel storage area meters', () => {+ it('announces measured relative sizes and keeps unavailable sizes indeterminate', () => {+ const report = {+ ...makeReport('2026-08-16T00:00:00.000Z'),+ storageAreas: [+ { id: 'database', label: 'Database', sizeBytes: 500, status: 'ready', note: 'Primary records.' },+ { id: 'empty', label: 'Empty area', sizeBytes: 0, status: 'ready', note: 'Measured empty area.' },+ { id: 'models', label: 'Models', sizeBytes: null, status: 'unavailable', note: 'Model storage.' },+ ],+ };+ render(+ <MemoryRouter>+ <StoragePanel report={report} loading={false} onRunReport={() => {}} onReport={() => {}} cleanup={cleanup} />+ </MemoryRouter>,+ );++ const measured = screen.getByRole('progressbar', { name: 'Database storage area size relative to largest known area' });+ expect(measured).toHaveAttribute('aria-valuenow', '100');+ expect(measured).not.toHaveAttribute('aria-valuetext');++ const empty = screen.getByRole('progressbar', { name: 'Empty area storage area size relative to largest known area' });+ expect(empty).toHaveAttribute('aria-valuenow', '0');+ expect(empty).not.toHaveAttribute('aria-valuetext');++ const unavailable = screen.getByRole('progressbar', { name: 'Models storage area size relative to largest known area' });+ expect(unavailable).not.toHaveAttribute('aria-valuenow');+ expect(unavailable).toHaveAttribute('aria-valuetext', 'Unavailable');+ expect(unavailable.firstElementChild.className).not.toContain('animate-pulse');+ });+});diff --git a/client/src/components/ui/ProgressBar.jsx b/client/src/components/ui/ProgressBar.jsxindex 02ef584662..4e36f92bc7 100644--- a/client/src/components/ui/ProgressBar.jsx+++ b/client/src/components/ui/ProgressBar.jsx@@ -22,13 +22,17 @@* success; a stopped autopilot run reads warning.* label — the accessible name. Required in spirit; defaults to 'Progress'* so the trio is never nameless.+ * valueText — optional spoken value, useful when a measurement is unavailable.* size — `sm` (h-1.5, default) or `md` (h-2, the drill timer).- * track — `bg` (on a card, default) or `border` (on the page ground, where- * `bg-port-bg` would vanish).+ * track — `bg` (on a card, default), `border` (on the page ground, where+ * `bg-port-bg` would vanish), or `borderMuted`.* duration — fill transition in ms. Static class map, because Tailwind can't* see an interpolated `duration-${n}` and would drop it from the* build.* `className` passes through for layout only (`flex-1`, `mt-1.5`).+ * `fillClassName` passes through for a surface-specific fill treatment.+ * `indeterminateAnimation={false}` keeps an unknown value visually empty when+ * pulsing would suggest that a scan is still running.*/const TONES = {@@ -48,6 +52,7 @@ const SIZES = {const TRACKS = {bg: 'bg-port-bg',border: 'bg-port-border',+ borderMuted: 'bg-port-border/60',};// Interpolated Tailwind class names are invisible to the build, so the only@@ -74,10 +79,13 @@ export default function ProgressBar({percent,tone = 'accent',label = 'Progress',+ valueText,size = 'sm',track = 'bg',duration = 200,className = '',+ fillClassName = '',+ indeterminateAnimation = true,}) {const value = clampPercent(percent);const indeterminate = value === null;@@ -95,8 +103,9 @@ export default function ProgressBar({'h-full rounded-full',fillTone,indeterminate- ? 'w-1/3 animate-pulse'+ ? (indeterminateAnimation ? 'w-1/3 animate-pulse' : 'w-0'): `transition-[width] ${DURATIONS[duration] || DURATIONS[200]}`,+ fillClassName,].join(' ');return (@@ -104,6 +113,7 @@ export default function ProgressBar({className={trackCls}role="progressbar"aria-label={label}+ aria-valuetext={valueText}aria-valuenow={indeterminate ? undefined : Math.round(value)}aria-valuemin={0}aria-valuemax={100}diff --git a/client/src/components/ui/ProgressBar.test.jsx b/client/src/components/ui/ProgressBar.test.jsxindex baae793097..6f6f239270 100644--- a/client/src/components/ui/ProgressBar.test.jsx+++ b/client/src/components/ui/ProgressBar.test.jsx@@ -66,6 +66,20 @@ describe('ProgressBar', () => {},);+ it('can give an indeterminate measurement a textual value', () => {+ render(<ProgressBar percent={null} label="Database storage area size" valueText="Unavailable" />);+ const bar = screen.getByRole('progressbar', { name: 'Database storage area size' });+ expect(bar).not.toHaveAttribute('aria-valuenow');+ expect(bar).toHaveAttribute('aria-valuetext', 'Unavailable');+ });++ it('can show an unavailable measurement without suggesting active progress', () => {+ const { container } = render(<ProgressBar percent={null} label="Storage size" valueText="Unavailable" indeterminateAnimation={false} />);+ expect(fillOf(container).className).toContain('w-0');+ expect(fillOf(container).className).not.toContain('animate-pulse');+ expect(screen.getByRole('progressbar')).not.toHaveAttribute('aria-valuenow');+ });+it.each([['accent', 'bg-port-accent'],['accent2', 'bg-port-accent-2'],@@ -91,6 +105,12 @@ describe('ProgressBar', () => {expect(container.querySelector('.h-1\\.5')).toBeNull();});+ it('supports a muted border track and custom fill treatment', () => {+ const { container } = render(<ProgressBar percent={50} track="borderMuted" fillClassName="bg-gradient-to-r from-port-accent to-cyan-400" label="x" />);+ expect(screen.getByRole('progressbar').className).toContain('bg-port-border/60');+ expect(fillOf(container).className).toContain('bg-gradient-to-r');+ });+it('defaults to the small size on the card ground', () => {render(<ProgressBar percent={50} label="x" />);const bar = screen.getByRole('progressbar');