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:
parent
d067c02d33
commit
b816203c0c
45 changed files with 760 additions and 208 deletions
|
|
@ -267,11 +267,22 @@ export function Field({ field, value, row, options, error, onChange, onPatch }:
|
|||
};
|
||||
const showFiles = field.files && !locked && (!field.filesWhen || fieldShown({ when: field.filesWhen }, row));
|
||||
|
||||
// The line under the field (its error, the deleted-row warning, or
|
||||
// its help) is read with it, and the field says when it's required
|
||||
// or wrong, not only the red star and border.
|
||||
const noteId = `${id}-note`;
|
||||
const hasNote = Boolean(error || (orphaned && !locked) || (helpText(field, row) && widget !== "checkbox"));
|
||||
const described = {
|
||||
"aria-describedby": hasNote ? noteId : undefined,
|
||||
"aria-invalid": Boolean(error || (orphaned && !locked)) || undefined,
|
||||
"aria-required": (field.required && !locked) || undefined,
|
||||
};
|
||||
const common = {
|
||||
id,
|
||||
className: `${input} ${error ? inputError : ""}`,
|
||||
value: value ?? "",
|
||||
onChange: (e) => onChange(e.target.value),
|
||||
...described,
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
@ -336,6 +347,7 @@ export function Field({ field, value, row, options, error, onChange, onPatch }:
|
|||
value={/^#[0-9a-f]{6}$/i.test(value ?? "") ? value : colorPlaceholder(field, row)}
|
||||
disabled={locked}
|
||||
onChange={(e) => onChange(e.target.value)}
|
||||
aria-label={`${typeof field.label === "function" ? field.label(row) : field.label}: pick a color`}
|
||||
className="h-9 w-12 shrink-0 border border-muted/25 bg-surface disabled:opacity-50"
|
||||
/>
|
||||
<input
|
||||
|
|
@ -398,6 +410,7 @@ export function Field({ field, value, row, options, error, onChange, onPatch }:
|
|||
value={value ?? ""}
|
||||
onChange={(e) => onChange(e.target.value)}
|
||||
placeholder={field.placeholder}
|
||||
{...described}
|
||||
className="w-full border-0 bg-transparent p-0 text-body outline-none placeholder:text-muted/45"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -421,15 +434,15 @@ export function Field({ field, value, row, options, error, onChange, onPatch }:
|
|||
</div>
|
||||
|
||||
{error ? (
|
||||
<p className="mt-1 text-xs text-danger">{error}</p>
|
||||
<p id={noteId} className="mt-1 text-xs text-danger">{error}</p>
|
||||
) : orphaned && !locked ? (
|
||||
<p className="mt-1 text-xs text-danger">
|
||||
<p id={noteId} className="mt-1 text-xs text-danger">
|
||||
This points at something that has been deleted. Pick a replacement before saving.
|
||||
</p>
|
||||
) : (
|
||||
helpText(field, row) &&
|
||||
widget !== "checkbox" && (
|
||||
<p className="mt-1 text-xs text-muted">{helpText(field, row)}</p>
|
||||
<p id={noteId} className="mt-1 text-xs text-muted">{helpText(field, row)}</p>
|
||||
)
|
||||
)}
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue