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: make Global Pause help accessible to keyboard and touch users (#2376)
Adam Eivy6f8f4efb8605
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex ad9334adbe..4d5b34508e 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -2,6 +2,8 @@## Accessibility+- **[issue-2376] The CoS Schedule "Global Pause" help is now reachable by keyboard and touch.** Its explanation used to live in a CSS-only `group-hover` popover on a non-focusable info icon, so keyboard and touch users could never read what pausing does before toggling it. It now uses a new reusable, accessible `InfoTooltip` (`client/src/components/ui/InfoTooltip.jsx`): a focusable `<button>` trigger that reveals the help on hover, keyboard focus, OR click/tap, dismisses on Escape or outside click, and links the panel to the trigger via `role="tooltip"` + `aria-describedby` (with `aria-expanded` on the button). The compact inline layout and existing pause toggle are unchanged.+- **The reference-audio waveform is now keyboard-operable and two hand-rolled modals gained real dialog semantics.** The Songs "reference analysis" waveform scrubber was a mouse-only `<div onClick>` (`role="presentation"`) — keyboard and screen-reader users could not seek at all. It is now a proper `role="slider"` with `aria-valuemin/max/now/valuetext`, focusable, and scrubbable with the arrow keys (±1s, ±5s with Shift) plus Home/End (WCAG 2.1.1). Separately, the CyberCity photo-mode "postcard preview" overlay and the Catalog "pick from media gallery" picker were hand-rolled `fixed inset-0` backdrops with no `role="dialog"`, no `aria-modal`, no Escape-to-close, and no focus trap; both now render through the shared `Modal` (focus trap + Esc stack + labelled dialog), with the postcard preview portaled so it escapes the WebGL HUD's stacking/pointer-events context.- **Modals and drawers now trap and restore keyboard focus, and toasts are announced to screen readers.** Opening any shared `Modal` or `Drawer` (which back the great majority of the app's dialogs, config drawers, and lightboxes) now moves focus into the dialog, keeps Tab/Shift+Tab cycling inside it instead of leaking to the page behind, and returns focus to the control that opened it on close (WCAG 2.4.3 / 2.1.2) — implemented once in a reusable `useFocusTrap` hook. The toast stack is now a labelled ARIA notification region: default toasts announce politely (`role="status"`) and error toasts assertively (`role="alert"`), with the decorative status glyphs hidden from assistive tech, so screen-reader users hear notifications (including error toasts) as they arrive.diff --git a/client/src/components/cos/tabs/schedule/GlobalConfigControls.jsx b/client/src/components/cos/tabs/schedule/GlobalConfigControls.jsxindex 93b4d362f2..2261134fb6 100644--- a/client/src/components/cos/tabs/schedule/GlobalConfigControls.jsx+++ b/client/src/components/cos/tabs/schedule/GlobalConfigControls.jsx@@ -1,9 +1,10 @@import { useState, useEffect } from 'react';-import { RotateCcw, AlertCircle, Info } from 'lucide-react';+import { RotateCcw, AlertCircle } from 'lucide-react';import CronInput from '../../../CronInput';import { AGENT_OPTIONS, DEFAULT_REVIEW_STOP_MODE, PR_AUTHOR_FILTER_OPTIONS, ISSUE_AUTHOR_FILTER_OPTIONS, ISSUE_AUTHOR_FILTER_TASK_TYPES, SWARM_COUNT_OPTIONS, SWARM_TASK_TYPES } from '../../constants';import ReviewerPicker from '../../ReviewerPicker';import Banner from '../../../ui/Banner';+import InfoTooltip from '../../../ui/InfoTooltip';import { FormField } from '../../../ui/FormField';import { formatDateTime } from '../../../../utils/formatters';import { useCodeReviewDefaults } from '../../../../hooks/useCodeReviewDefaults';@@ -158,12 +159,9 @@ export default function GlobalConfigControls({ taskType, config, onUpdate, onTri<div className="flex items-center justify-between"><div className="flex items-center gap-1.5"><label className="text-sm text-gray-400">Global Pause</label>- <div className="group relative">- <Info size={14} className="text-gray-500 cursor-help" />- <div className="absolute bottom-full left-1/2 -translate-x-1/2 mb-1.5 px-3 py-2 bg-gray-800 border border-port-border text-xs text-gray-300 rounded-lg shadow-lg w-56 opacity-0 pointer-events-none group-hover:opacity-100 group-hover:pointer-events-auto transition-opacity z-50">- When paused, no scheduled runs will execute for this task — even if individual apps are enabled.- </div>- </div>+ <InfoTooltip label="What does Global Pause do?">+ When paused, no scheduled runs will execute for this task — even if individual apps are enabled.+ </InfoTooltip></div><ToggleSwitchenabled={isPaused}diff --git a/client/src/components/ui/InfoTooltip.jsx b/client/src/components/ui/InfoTooltip.jsxnew file mode 100644index 0000000000..431bf84069--- /dev/null+++ b/client/src/components/ui/InfoTooltip.jsx@@ -0,0 +1,82 @@+import { useCallback, useEffect, useId, useRef, useState } from 'react';+import { Info } from 'lucide-react';+import useClickOutside from '../../hooks/useClickOutside';++// Accessible info/help tooltip. Renders a focusable <button> trigger with an+// Info icon; the help text is revealed on hover, keyboard focus, OR click/tap,+// and dismissed with Escape or a click/tap outside. This replaces CSS-only+// `group-hover` affordances on non-focusable icons, which keyboard and touch+// users can never reach.+//+// ARIA: the panel carries `role="tooltip"` and is linked to the trigger via+// `aria-describedby` while visible, so screen readers announce it; the button's+// `aria-expanded` reflects the click-latched open state. Pass `children` as the+// help text and `label` as the button's accessible name.+export default function InfoTooltip({+ children,+ label = 'More information',+ className = '',+ panelClassName = 'w-56',+ iconSize = 14,+ align = 'center',+}) {+ // `open` is click/tap-latched (survives blur until Escape or outside click);+ // `hovered` is the transient hover/focus reveal. Either makes the panel visible.+ const [open, setOpen] = useState(false);+ const [hovered, setHovered] = useState(false);+ const wrapRef = useRef(null);+ const panelId = useId();+ const close = useCallback(() => {+ setOpen(false);+ setHovered(false);+ }, []);++ useClickOutside(wrapRef, open, () => setOpen(false));++ useEffect(() => {+ if (!open && !hovered) return undefined;+ const onKey = (e) => {+ if (e.key === 'Escape') close();+ };+ document.addEventListener('keydown', onKey);+ return () => document.removeEventListener('keydown', onKey);+ }, [open, hovered, close]);++ const visible = open || hovered;+ const alignClass = align === 'start'+ ? 'left-0'+ : align === 'end'+ ? 'right-0'+ : 'left-1/2 -translate-x-1/2';++ return (+ <div+ ref={wrapRef}+ className={`relative inline-flex ${className}`}+ onMouseEnter={() => setHovered(true)}+ onMouseLeave={() => setHovered(false)}+ >+ <button+ type="button"+ aria-label={label}+ aria-expanded={open}+ aria-describedby={visible ? panelId : undefined}+ onClick={() => setOpen((v) => !v)}+ onFocus={() => setHovered(true)}+ onBlur={() => setHovered(false)}+ className="inline-flex items-center rounded text-gray-500 transition-colors hover:text-gray-300 focus:text-gray-300 focus:outline-none focus-visible:ring-1 focus-visible:ring-port-accent"+ >+ <Info size={iconSize} aria-hidden="true" />+ </button>+ {visible && (+ <div+ id={panelId}+ role="tooltip"+ className={`absolute bottom-full ${alignClass} z-50 mb-1.5 rounded-lg border border-port-border bg-gray-800 px-3 py-2 text-xs text-gray-300 shadow-lg ${panelClassName}`}+ >+ {children}+ </div>+ )}+ </div>+ );+}diff --git a/client/src/components/ui/InfoTooltip.test.jsx b/client/src/components/ui/InfoTooltip.test.jsxnew file mode 100644index 0000000000..0edf553667--- /dev/null+++ b/client/src/components/ui/InfoTooltip.test.jsx@@ -0,0 +1,46 @@+import { describe, it, expect } from 'vitest';+import { render, screen, fireEvent } from '@testing-library/react';++import InfoTooltip from './InfoTooltip';++describe('InfoTooltip', () => {+ it('exposes a focusable button trigger with an accessible label', () => {+ render(<InfoTooltip label="What does this do?">Help text</InfoTooltip>);+ const btn = screen.getByRole('button', { name: 'What does this do?' });+ expect(btn.tagName).toBe('BUTTON');+ expect(btn).toHaveAttribute('type', 'button');+ // Help text is hidden until revealed.+ expect(screen.queryByRole('tooltip')).toBeNull();+ });++ it('reveals the tooltip on keyboard focus and links it via aria-describedby', () => {+ render(<InfoTooltip label="help">Keyboard reachable</InfoTooltip>);+ const btn = screen.getByRole('button', { name: 'help' });+ fireEvent.focus(btn);+ const panel = screen.getByRole('tooltip');+ expect(panel).toHaveTextContent('Keyboard reachable');+ expect(btn.getAttribute('aria-describedby')).toBe(panel.getAttribute('id'));+ });++ it('toggles (latches) open on click for touch users and reflects aria-expanded', () => {+ render(<InfoTooltip label="help">Tap reachable</InfoTooltip>);+ const btn = screen.getByRole('button', { name: 'help' });+ expect(btn).toHaveAttribute('aria-expanded', 'false');+ fireEvent.click(btn);+ expect(btn).toHaveAttribute('aria-expanded', 'true');+ expect(screen.getByRole('tooltip')).toHaveTextContent('Tap reachable');+ // Latched open survives blur (unlike a pure hover surface).+ fireEvent.blur(btn);+ expect(screen.getByRole('tooltip')).toBeTruthy();+ });++ it('dismisses the latched tooltip on Escape', () => {+ render(<InfoTooltip label="help">Dismissable</InfoTooltip>);+ const btn = screen.getByRole('button', { name: 'help' });+ fireEvent.click(btn);+ expect(screen.getByRole('tooltip')).toBeTruthy();+ fireEvent.keyDown(document, { key: 'Escape' });+ expect(screen.queryByRole('tooltip')).toBeNull();+ expect(btn).toHaveAttribute('aria-expanded', 'false');+ });+});