mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
Harden Workboard modal and drawer accessibility.
Summary:
- Add Workboard dialog focus lifecycle handling for initial focus, Tab/Shift+Tab containment, Escape close, and opener restore.
- Mark Workboard background content inert/aria-hidden while modal or drawer dialogs are active.
- Add focused unit and Chromium browser smoke coverage for the audited modal/drawer accessibility requirements.
- Keep UI browser test aliases able to resolve shared workspace packages used by the Workboard view.
Verification:
- node scripts/run-vitest.mjs ui/src/ui/views/workboard.test.ts
- node scripts/run-vitest.mjs ui/src/ui/views/workboard.browser.test.ts
- (cd ui && pnpm exec vitest run --config vitest.config.ts --project browser src/ui/views/workboard.browser.test.ts)
- GitHub checks green at 6557012430
38 lines
1.3 KiB
TypeScript
38 lines
1.3 KiB
TypeScript
import fs from "node:fs";
|
|
import os from "node:os";
|
|
import path from "node:path";
|
|
import { describe, expect, it } from "vitest";
|
|
import {
|
|
readCronMcpCleanupProbePidWaitMs,
|
|
waitForProbePid,
|
|
} from "../../scripts/e2e/cron-mcp-cleanup-docker-client.ts";
|
|
|
|
describe("cron MCP cleanup docker client", () => {
|
|
it("rejects malformed probe pid wait limits", () => {
|
|
expect(readCronMcpCleanupProbePidWaitMs({})).toBe(120_000);
|
|
expect(readCronMcpCleanupProbePidWaitMs({ OPENCLAW_CRON_MCP_CLEANUP_PID_WAIT_MS: "250" })).toBe(
|
|
250,
|
|
);
|
|
for (const value of ["1.5", "1e3", "10ms", "0"]) {
|
|
expect(() =>
|
|
readCronMcpCleanupProbePidWaitMs({
|
|
OPENCLAW_CRON_MCP_CLEANUP_PID_WAIT_MS: value,
|
|
}),
|
|
).toThrow("invalid OPENCLAW_CRON_MCP_CLEANUP_PID_WAIT_MS");
|
|
}
|
|
});
|
|
|
|
it("bounds missing probe pid waits", async () => {
|
|
const root = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-cron-mcp-client-"));
|
|
try {
|
|
const startedAt = Date.now();
|
|
await expect(
|
|
waitForProbePid(path.join(root, "missing.pid"), { pollMs: 1, timeoutMs: 20 }),
|
|
).resolves.toBeUndefined();
|
|
expect(Date.now() - startedAt).toBeLessThan(1000);
|
|
} finally {
|
|
fs.rmSync(root, { force: true, recursive: true });
|
|
}
|
|
});
|
|
});
|