diff --git a/.changeset/accessibility-statement.md b/.changeset/accessibility-statement.md new file mode 100644 index 000000000..2d0f4f799 --- /dev/null +++ b/.changeset/accessibility-statement.md @@ -0,0 +1,4 @@ +--- +--- + +No release. The repo has an accessibility statement, `ACCESSIBILITY.md`, and an issue form for reporting a barrier on the docs site. The docs site links to it. diff --git a/.github/ISSUE_TEMPLATE/accessibility.yml b/.github/ISSUE_TEMPLATE/accessibility.yml new file mode 100644 index 000000000..3264c133e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/accessibility.yml @@ -0,0 +1,48 @@ +name: Accessibility barrier +description: Something on the documentation site stops you from doing what you came to do, or makes it harder. +labels: ["accessibility"] +body: + - type: markdown + attributes: + value: | + You do not need to tell us about a disability, or send a screenshot or a recording. + This issue is public, so leave out anything you want to keep private. + - type: input + id: page + attributes: + label: Page + description: The address of the page, or its name. + placeholder: "https://northguild.dev/gmt/tools/dst-inspector/" + validations: + required: true + - type: input + id: task + attributes: + label: Task + description: What you were trying to do. + placeholder: "Choose a time zone from the list" + validations: + required: true + - type: textarea + id: happened + attributes: + label: What happened + description: What got in the way. + placeholder: "I could not reach the list with the keyboard." + validations: + required: true + - type: input + id: browser + attributes: + label: Browser + description: Optional. The browser, with its version if you know it. + - type: input + id: system + attributes: + label: Operating system + description: Optional. Such as Windows, macOS, iOS, Android or Linux. + - type: input + id: assistive + attributes: + label: Assistive technology + description: Optional. Any software, device or browser setting you use, such as a screen reader, screen magnifier, voice control or larger text. diff --git a/ACCESSIBILITY.md b/ACCESSIBILITY.md new file mode 100644 index 000000000..fa25e6707 --- /dev/null +++ b/ACCESSIBILITY.md @@ -0,0 +1,116 @@ +# Accessibility + +We want everyone to be able to use the GMT documentation site, including people who use a +keyboard, a screen reader, magnification or their own colours. If something gets in your way, +[report a barrier](https://github.com/northguild/gmt/issues/new?template=accessibility.yml). +The form needs a GitHub account. Without one, email . + +## Scope + +This statement covers the documentation site at , with its guides, +tools, slides and chat. + +The npm packages in `packages/` return plain values such as strings and draw no interface. The app +that shows those values decides how accessible they are. + +## Target + +We aim for the Web Content Accessibility Guidelines (WCAG) 2.2, level AA, across the site. This is +a target. We do not claim that the site conforms. + +## What we test + +- **Pages.** An automated check, `a11y-axe`, runs axe-core's WCAG level A and AA rules. Every week + it checks every page in Chromium, in the dark and light themes, at a desktop and a phone width. + It also checks a sample of pages in Firefox and WebKit. A finding that shows again on a second + run is filed in an issue. +- **Changes.** On a pull request that changes the site, the same check runs in Chromium on the + pages the change affects, or on a sample of them. It reports problems and does not block the + merge. +- **Components.** The tests of our shared components run axe-core too, and press the keys of the + shared controls. They skip colour contrast and target size, which need a real page. +- **The data-credits button.** A check opens and closes it from the keyboard, in Chromium, Firefox + and WebKit. +- **Code and styles.** Lint rules check the React code for common accessibility mistakes, and the + stylesheets for hidden focus outlines and unreadably small text. +- **Contrast.** The colours for body text, links and code, and the globe's labels, are designed + for a contrast of 7:1. Unit tests hold them there on the backgrounds they are designed for. This + does not cover every piece of text. + +The site is designed for four preferences: reduced motion, reduced transparency, more contrast and +forced colours. Browser tests turn on reduced motion for one tool and forced colours for the +clock-change maps. Unit tests cover some of the preferences in some scripts. No test covers all +four across the site. + +Automated checks find only some barriers. They cannot tell whether a page makes sense. + +## Supported environments + +Our automated page checks run in Chromium, Firefox and WebKit, the engines that Chrome and Edge, +Firefox, and Safari are built on. Our target includes using the site with the keyboard alone. + +In Safari on macOS, Tab skips buttons unless you turn on "Press Tab to highlight each item on a +webpage" in Safari's settings. Option+Tab moves to them without that setting. + +## Known limitations + +We know of no barrier on the site. When one is confirmed, we describe here what it stops a reader +from doing and link to its issue, until it is fixed. See the +[open accessibility issues](https://github.com/northguild/gmt/issues?q=is%3Aissue%20state%3Aopen%20label%3Aaccessibility). + +We have not tested: + +- the whole site by hand, with the keyboard alone or in the released versions of Chrome, Safari and + Firefox; +- any screen reader; +- voice control, switch access or screen magnification; +- the four preferences above, by hand, on every page; +- most states that appear only after you act, such as an open menu, a tool's result or a chat + answer, on the built pages; +- the WCAG criteria that axe-core cannot check, such as whether focus is hidden behind other + content, whether dragging has an alternative, or whether help is in a consistent place. + +## Changing the site + +The maintainers change the site; pull requests from others are accepted only for the packages +([CONTRIBUTING.md](./CONTRIBUTING.md#contributions)). These rules apply to people and to coding +agents alike: + +- `pnpm run validate` passes. It runs the lint rules and the component tests that the change needs. +- The `a11y-axe` findings that the pull request's "Dox gates" check reports are fixed. +- A new shared component has a test that runs axe-core and presses its keys. +- An `a11y-axe` finding is waived in one place only, + [`a11y-axe-exclusions.json`](./apps/dox/scripts/a11y-axe-exclusions.json). An entry names the + rule, the element and the pages, and gives measured evidence that the finding is false. A real + barrier is fixed, never excluded. + +## Report a barrier + +[Open the accessibility form](https://github.com/northguild/gmt/issues/new?template=accessibility.yml). +It adds the `accessibility` label. Tell us the page, what you were trying to do and what happened. +The browser, the operating system and any assistive technology help us, if you want to share them. + +The form needs a GitHub account. Without one, email +[accessibility@northguild.dev](mailto:accessibility@northguild.dev). We may open an issue about +the barrier, and it will not name you or show your address. + +You never need to tell us about a disability, or send a screenshot or a recording. Issues are +public, so leave out anything you want to keep private. + +## What happens next + +1. We reply in the issue, or to your email, to say we have read it. +2. We try to reproduce the barrier, and ask in the issue when we need more. +3. We say what we will do, or why we cannot fix it. +4. When a fix is on the site, we say so in the issue. You can check it. If the barrier is still + there, tell us and we reopen the issue. + +If you wrote by email, steps 2 to 4 reach you by email too. + +We do not promise a date for a reply or a fix. + +## Who keeps this current + +The NorthGuild maintainers own this statement. They update it in the same pull request as any +change to what we test or support. To suggest a change to it, +[open an issue](https://github.com/northguild/gmt/issues/new/choose) or email the address above. diff --git a/apps/dox/scripts/affected.test.ts b/apps/dox/scripts/affected.test.ts index e89fbb801..0a649ed96 100644 --- a/apps/dox/scripts/affected.test.ts +++ b/apps/dox/scripts/affected.test.ts @@ -16,6 +16,11 @@ const allBut = (...skip: string[]) => describe("affected: which checks a change runs", () => { it.each([ + { + name: "the root policy documents run nothing", + changes: ["ACCESSIBILITY.md", "SECURITY.md"], + checks: [], + }, { name: "notes in context/ run nothing", changes: ["context/dox/built/index.md", "context/skills.md"], diff --git a/apps/dox/scripts/pr-meta/plan.test.ts b/apps/dox/scripts/pr-meta/plan.test.ts index 60abc38ef..da6f00955 100644 --- a/apps/dox/scripts/pr-meta/plan.test.ts +++ b/apps/dox/scripts/pr-meta/plan.test.ts @@ -110,6 +110,7 @@ describe("planMeta labels", () => { [".github/PULL_REQUEST_TEMPLATE.md", "gmt monorepo"], [".changeset/config.json", "gmt monorepo"], ["docs/dst-disambiguation.md", "documentation"], + ["ACCESSIBILITY.md", "documentation"], ["LICENSE", "documentation"], ["apps/LICENSE", "documentation"], ])("labels %s alone %s", (path, label) => { diff --git a/apps/dox/src/components/Footer.astro b/apps/dox/src/components/Footer.astro index e18fee685..655d8ff97 100644 --- a/apps/dox/src/components/Footer.astro +++ b/apps/dox/src/components/Footer.astro @@ -1,6 +1,7 @@ --- // Override of Starlight's Footer that appends the site's licence line and an empty end-of-page -// marker. The line is a closed disclosure that opens to the note in apps/LICENSE. The +// marker. The line is a closed disclosure that opens to the note in apps/LICENSE, with the +// accessibility link always visible beside it (first, so opening the note never moves it). The // `` in astro.config // holds the first paint of each page until the parser reaches this element. // Without it, Chrome paints a reference page (~200 KB, most of it sidebar) in @@ -9,6 +10,10 @@ import Link from "~/components/Link.astro"; import Default from '@astrojs/starlight/components/Footer.astro'; import { displayFaceInlineSource } from '~/lib/display-face'; +import { + ACCESSIBILITY_LINK_TEXT, + ACCESSIBILITY_URL, +} from '~/lib/accessibility-statement'; import { LICENCE_LEAD, LICENCE_LINK_TEXT, @@ -26,13 +31,16 @@ const onLanding = Astro.locals.starlightRoute.id === ''; {!inChatShell && !onLanding && ( -
- {LICENCE_SUMMARY} -

- {LICENCE_LEAD}{" "} - {LICENCE_LINK_TEXT}. -

-
+
+ {ACCESSIBILITY_LINK_TEXT} +
+ {LICENCE_SUMMARY} +

+ {LICENCE_LEAD}{" "} + {LICENCE_LINK_TEXT}. +

+
+
)} {/* Loads the display font from the stylesheet's bytes before the held first paint. See src/lib/display-face.ts. */}