Accessibility: reading and color blind modes, audit fixes, calendar window

- Accessibility panel: the switch knob stays in its track; the panel
  follows its button in the Tab order and opens on its first switch.
- Reading mode is the page as plain text: one column, no colors,
  pictures, cards or motion; descriptions stay in place.
- Color blind mode (protanopia, deuteranopia, tritanopia, monochrome):
  palette swaps chosen by simulation, applied to code, data and CSS
  colors on public pages only. The newsletter uses the stored palette.
- Audit fixes: focus not hidden by the header, focus on page change
  and in-page jumps, focus return for the menu, day list and people
  details, labelled admin fields and dialogs, keyboard map tiles,
  scrollable tables, and more.
- Calendar asks /events for its six weeks only (?from=&to=); carousels
  take their 12 most recent past events (?past=12).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-10-02 14:33:09 -05:00
parent d067c02d33
commit b816203c0c
45 changed files with 760 additions and 208 deletions

View file

@ -463,7 +463,7 @@ content.get("/events", (c) => {
// Optional filters, each narrowing the list (src/lib/eventData.ts):
// ?scope=national ?host=<org or person slug> ?status=upcoming
// ?type=class,workshop
// ?type=class,workshop ?from=&to= (a date window) ?past=12
const where = [`is_published = 1`, `is_listed = 1`];
const params = [];
const scope = c.req.query("scope");
@ -477,11 +477,38 @@ content.get("/events", (c) => {
if (status) where.push(`effective_status = ?`), params.push(status);
const types = (c.req.query("type") ?? "").split(",").filter(Boolean).slice(0, 20);
if (types.length) where.push(`event_type IN (${marks(types.length)})`), params.push(...types);
// ?from=2026-10-01&to=2026-11-07: only events with a day in that
// window (the calendar's six weeks), plus the undated ones it
// counts. Either end may be left off. A series with no end date
// runs on, so it stays in every window after its start.
const day = (name) => {
const value = c.req.query(name);
return /^\d{4}-\d{2}-\d{2}$/.test(value ?? "") ? value : null;
};
const from = day("from");
const to = day("to");
if (from || to) {
const dated = [];
if (to) dated.push(`starts_on <= ?`), params.push(to);
if (from) {
dated.push(`COALESCE(ends_on, CASE WHEN is_series = 1 THEN '9999-12-31' ELSE starts_on END) >= ?`);
params.push(from);
}
where.push(`(starts_on IS NULL OR (${dated.join(" AND ")}))`);
}
const rows = db
let rows = db
.prepare(`SELECT * FROM v_events WHERE ${where.join(" AND ")} ORDER BY ${EVENT_ORDER}`)
.all(...params);
// ?past=12: only the 12 most recent past events (a carousel's way
// back), before their links, cards and hosts are loaded.
const past = Number.parseInt(c.req.query("past") ?? "", 10);
if (past >= 0) {
let keep = rows.filter((row) => row.effective_status === "past").length - past;
rows = rows.filter((row) => row.effective_status !== "past" || keep-- <= 0);
}
const ids = rows.map((row) => row.id);
const links = loadLinks(db, "event", ids);
const cards = loadBlocks(db, "event", ids, "card");