loading-errors now forces each list API (/api/tasks, /api/captures, /api/event-types, /api/tokens, /api/access/policies) to fail and asserts the page shows its error surface, never its empty-state copy. accessibility gains two static-route sweeps: every input/textarea/select/ button must have an accessible name, and every keyboard focus stop's indicator (ring var, outline, shadow or focus border) must clear 3:1 against the background behind it. phone-overflow sweeps every static route at 390x844 for horizontal scroll. The sweeps caught real gaps, fixed here: the DurationInput amount input had no accessible name and its unit select no focus indicator, and TabsContent and CodeBlockContent were focusable with outline-none and no ring. The stale 'Sections' list selector now matches the nav landmark.
20 lines
679 B
JavaScript
20 lines
679 B
JavaScript
// The dashboard's static routes, read from the router source so a new page is
|
|
// swept automatically. Parameterised and redirect routes are skipped.
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
function staticRoutes() {
|
|
const src = fs.readFileSync(path.join(__dirname, '../../../ui/src/router/index.ts'), 'utf8');
|
|
const out = [];
|
|
for (const line of src.split('\n')) {
|
|
if (/redirect:/.test(line)) continue;
|
|
const m = line.match(/path: "([^"]*)"/);
|
|
if (!m || m[1].includes(':')) continue;
|
|
if (m[1].startsWith('/')) out.push(m[1]);
|
|
else if (m[1]) out.push('/org/' + m[1]);
|
|
}
|
|
return [...new Set(out)];
|
|
}
|
|
|
|
module.exports = { staticRoutes };
|