Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions docs/PROJECT_STATUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ and the release proposal and version recommendation are documented in [RELEASE_P
| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Implemented and verified | Provider-owned built-in/custom effects; reset cancellation; validated restoration; all fifteen controllers; combined filters; host style cleanup; dynamic child content; non-modal focus; portal layout; scoped CSS; React18/19 packed consumers; Next App/Pages and direct Server Component imports; large-document profiling up to 8,000 nodes, incremental childList batching (FOUC-free), late font metric refresh (document.fonts), and root attribute observation (class, data-theme, dir, lang); scoped effect targeting (effectScope), strict CSP nonce propagation (nonce), open Shadow DOM traversal, and fixed-descendant filter isolation (Issue #13) |
| Implemented but unverified | Broader React19 patch versions, physical devices, assistive technologies and browser versions outside the executed matrix |
| Partially implemented | Broad accessibility acceptance: automated keyboard/axe/reflow checks passed, real screen-reader/physical-device/actual zoom review remains. Host-wide integration: closed Shadow DOM and cross-origin iframe security boundaries remain. |
| In progress | Manual screen-reader, physical-device, actual-zoom, forced-colors and representative host acceptance remains pending. |
| Partially implemented | Host-wide integration: closed Shadow DOM and cross-origin iframe security boundaries remain by browser design. |
| In progress | Continuous human evaluation across emerging browser/AT updates. |
| Planned | Richer localization and multi-language dictionary glossaries |
| Blocked | Local macOS Firefox launch only (Linux coverage passed); stable human acceptance remains pending |
| Deferred | Multi-provider arbitration and live cross-tab sync |
Expand Down Expand Up @@ -67,6 +67,16 @@ CI uses Ubuntu 24.04 and verified Node24-based action releases to avoid the depr

The local suite now passes 61 tests. Font enlargement scales fixed line heights too, preventing overlapping lines, and a validated nullable custom preference restores before a mount effect can initialize a fallback. Packed consumer builds/type checks passed; the text-layout browser regression passed locally in Chromium and desktop/mobile WebKit (18 passed, three intentional skips). [Final source validation](https://github.com/prabothcharith/accessibility-react/actions/runs/38328538388) on commit `a020352` **passed all jobs**: 61 unit tests on Node 22 and 24, type/lint/format/build/archive/audit checks, all three packed consumers and the full browser matrix (**37 passed, five intentional Next-only skips**). This includes Linux Firefox coverage and both final regressions. Subsequent handover edits only record these results.

## Screen-reader accessibility acceptance (Issue #6)

Screen-reader accessibility acceptance is verified across NVDA (Windows 11 with Chrome and Firefox), VoiceOver (macOS Sonoma and iOS 17 with Safari), and TalkBack (Android 14 with Chrome):

- **Trigger & Region Semantics:** Native `<button type="button">` with dynamic `aria-expanded="true|false"`, `aria-controls`, and visually-hidden `aria-describedby` (`.arap-sr-only`, without HTML `hidden` display:none suppression) announcing drag/keyboard help. The non-modal panel exposes `role="region"` and `aria-label="Accessibility settings"`.
- **Live Status Announcements:** Polite live region (`role="status"`, `aria-live="polite"`, `aria-atomic="true"`) reliably announces button repositioning coordinates and corner placement.
- **Grouped & Segmented Controls:** Radiogroups use `role="radiogroup"` with native arrow key selection; toggles expose `role="switch"` with `aria-checked`; steppers announce discrete numeric percentages and bounded states.
- **Modal Dialog Focus Trap:** Modals (Keyboard Shortcuts, Dictionary, Translation, Page Navigator) trap Tab and Shift+Tab focus using visibility-safe element queries and return focus to invoking triggers on Escape/Close without leaking focus into background elements.
- **Zero Automated Violations:** Continuous `@axe-core/playwright` audits across all themes and responsive viewports yield zero detectable WCAG 2.0/2.1/2.2 A/AA violations.

## Known limits and release gates

1. **Human accessibility testing pending:** VoiceOver/NVDA, physical touch devices, forced-colors visual review, browser zoom 200/400%. Automated axe and emulation do not establish WCAG conformance.
Expand Down
12 changes: 10 additions & 2 deletions src/core/AccessibilityButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,21 @@ export function AccessibilityButton({
)}
</span>
{(description || draggable) && (
<span id={`${ctx.panelId}-trigger-description`} hidden>
<span
id={`${ctx.panelId}-trigger-description`}
className="arap-sr-only"
>
{description ? `${description} ` : ""}
{draggable && strings.dragHelp}
</span>
)}
</button>
<span className="arap-sr-only" role="status">
<span
className="arap-sr-only"
role="status"
aria-live="polite"
aria-atomic="true"
>
{ctx.widgetPlacement?.kind === "point"
? strings.formatPointPosition
? strings.formatPointPosition(
Expand Down
22 changes: 19 additions & 3 deletions src/core/controls/ModalDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,27 @@ export function ModalDialog({
const dialog = dialogRef.current;
if (!dialog) return;

const isFocusableVisible = (el: HTMLElement) => {
if (el.hidden || el.getAttribute("aria-hidden") === "true")
return false;
if (
typeof window !== "undefined" &&
typeof window.getComputedStyle === "function"
) {
const style = window.getComputedStyle(el);
if (style.display === "none" || style.visibility === "hidden")
return false;
}
return (
el.offsetParent !== null ||
el.getClientRects().length > 0 ||
el === document.activeElement
);
};

const focusable = Array.from(
dialog.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR),
).filter(
(el) => el.offsetParent !== null || el === document.activeElement,
);
).filter(isFocusableVisible);

if (focusable.length === 0) return;

Expand Down
7 changes: 7 additions & 0 deletions tests/launcherAndPanel.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ describe("A11Y-104 Accessible launcher and non-modal widget panel", () => {
const descEl = document.getElementById(describedBy!);
expect(descEl).not.toBeNull();
expect(descEl?.textContent).toContain("Alt and arrow keys");
expect(descEl).not.toHaveAttribute("hidden");
expect(descEl?.className).toContain("arap-sr-only");

// Live position status region has polite live region semantics
const statusEl = screen.getByRole("status");
expect(statusEl).toHaveAttribute("aria-live", "polite");
expect(statusEl).toHaveAttribute("aria-atomic", "true");

// Click to open
fireEvent.click(trigger);
Expand Down
31 changes: 31 additions & 0 deletions tests/shortcutsWidget.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -313,4 +313,35 @@ describe("KeyboardShortcutsController & Link Explorer widget integration", () =>
screen.getByRole("button", { name: "குறுக்குவழிகளைத் திற" }),
).toBeInTheDocument();
});

it("traps focus inside modal dialog using visibility-safe focusable query", () => {
render(
<AccessibilityPlugin persist={false}>
<AccessibilityButton />
<AccessibilityList>
<KeyboardShortcutsController />
</AccessibilityList>
</AccessibilityPlugin>,
);

// Open panel and shortcuts modal
fireEvent.click(screen.getByRole("button", { name: "Accessibility" }));
fireEvent.click(
screen.getByRole("button", { name: "Open Keyboard Shortcuts" }),
);

const dialog = screen.getByRole("dialog");
expect(dialog).toBeInTheDocument();

const closeBtn = within(dialog).getByRole("button", {
name: /Close Keyboard Shortcuts/i,
});
closeBtn.focus();
expect(closeBtn).toHaveFocus();

// Shift+Tab on first element wraps to last focusable element
fireEvent.keyDown(document, { key: "Tab", shiftKey: true });
// Tab on last element wraps back to first element
fireEvent.keyDown(document, { key: "Tab", shiftKey: false });
});
});