From a3695a33f004000b1e11a70cd851d81a3de51b02 Mon Sep 17 00:00:00 2001 From: "Craig C." Date: Mon, 30 Nov 2026 19:51:18 +0200 Subject: [PATCH 1/3] docs: add an accessibility statement and barrier form (DOX-G20, #592) Add ACCESSIBILITY.md and an issue form for reporting a barrier on the docs site. The form applies the `accessibility` label. The path rules in affected.mjs and pr-meta-plan.mjs treat the statement as a root document. The gate notes no longer say a test holds --gmt-ice-dim at 7:1. --- .changeset/accessibility-statement.md | 4 + .github/ISSUE_TEMPLATE/accessibility.yml | 48 ++++++++++ ACCESSIBILITY.md | 109 +++++++++++++++++++++++ apps/dox/scripts/affected.test.ts | 5 ++ apps/dox/scripts/pr-meta/plan.test.ts | 1 + context/dox/built/tier-2-gates.md | 2 +- context/dox/built/tier-6-runbooks.md | 2 +- context/dox/tracker.md | 1 + scripts/lib/affected.mjs | 2 +- scripts/lib/pr-meta-plan.mjs | 4 +- 10 files changed, 173 insertions(+), 5 deletions(-) create mode 100644 .changeset/accessibility-statement.md create mode 100644 .github/ISSUE_TEMPLATE/accessibility.yml create mode 100644 ACCESSIBILITY.md diff --git a/.changeset/accessibility-statement.md b/.changeset/accessibility-statement.md new file mode 100644 index 000000000..f803b3faa --- /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. 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..96a06f6c6 --- /dev/null +++ b/ACCESSIBILITY.md @@ -0,0 +1,109 @@ +# 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). + +## 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. + +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 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. + +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). 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/context/dox/built/tier-2-gates.md b/context/dox/built/tier-2-gates.md index 5e903e960..42cc26231 100644 --- a/context/dox/built/tier-2-gates.md +++ b/context/dox/built/tier-2-gates.md @@ -11,7 +11,7 @@ Dox has three gates: `a11y-axe`, `rendered-links` and `data-credits-check`. They - The page contract: each gate script answers `--list-pages` (a JSON array of site paths, no browser launched), `--pages ` (an unknown path is a usage error, exit 2) and `--base`, through `applyPageContract` in `scripts/gates/contract.mjs`. Each finding goes through `recordFinding` (`scripts/gates/findings.mjs`) to the file named by `GATE_REPORT`; `recordMeasured` counts what a run measured, and a run that measured nothing fails. - `rendered-links` (`scripts/rendered-links.mjs`, Chromium, one theme) opens every built page with a `data-widget` element (`listWidgetPages` in `scripts/lib/widget-pages.mjs`, a use of the `listBuiltPages` walker in `scripts/lib/built-pages.mjs`, read from `dist`, never a fixed list) at 1440 x 900, waits for a widget root and `settle`, then reads the `href` attribute of every `a[href]` and `area[href]` as written. A relative value is resolved against the page with `resolveHref`, and `isPageLinkWithoutSlash` (`scripts/lib/page-links.mjs`, the predicate `test:dist` uses) judges it. Rule `page-link-without-slash` names the page, the value and the widget that holds the link; rule `check-crashed` is a page that would not load. Links that appear only after a click are left to each tool's own tests. Takes `--base`, `--browsers`, `--pages`, `--list-pages` and `--shard /`. - `data-credits-check` (`scripts/data-credits-check.mjs`, three engines) checks the data-credits info button on `/`, `/tools/zoned-earth/`, `/why-gmt/` and the Canada and Morocco clock-change pages, at 1280 x 800 and 375 x 812 and at scroll top, middle and bottom: the button overlaps no focusable element or text, Tab (Option+Tab in WebKit) reaches it, Enter opens the popover, the accessibility tree shows it expanded, Escape closes it and returns focus, and the open panel sits in the viewport and covers no control. A globe stack is entered by ArrowUp from Zoom in, which wraps to the info button, and one Tab from Zoom in leaves the toolbar. The browser zone is pinned so Locate shows. It waits for the panel's animations to finish, never a fixed delay, before it reads the panel's opacity. On `/` it also reads the "Coming up in the sky" list at two pinned instants. -- `a11y-axe` (`scripts/a11y-axe.mjs`, three engines, both themes, 1440 and 390 px) runs axe-core on every built page (`distPages` in `scripts/lib/a11y-sweep.mjs`) and fails any violation. `scripts/a11y-axe-exclusions.json` is the only place a rule or selector may be waived: an entry covers a result only when rule, selector and page all match, and its `reason` gives measured evidence of a false positive. A real violation is fixed, never excluded. A change to the file runs the gate on the sample (`inputIndex()` in the registry). +- `a11y-axe` (`scripts/a11y-axe.mjs`, three engines, both themes, 1440 and 390 px) runs axe-core on every built page (`distPages` in `scripts/lib/a11y-sweep.mjs`) and fails any violation. `scripts/a11y-axe-exclusions.json` is the only place a rule or selector may be waived: an entry covers a result only when rule, selector and page all match, and its `reason` gives measured evidence of a false positive. A real violation is fixed, never excluded. A change to the file runs the gate on the sample (`inputIndex()` in the registry). A change to what a gate covers updates `ACCESSIBILITY.md` in the same pull request. - Pass and fail logic shared by the gates lives in `scripts/gate-checks.mjs` (`emptyRunProblem`, `blockOffSite`, the exclusion matchers, `locatorCountProblem`), tested by `gate-checks.test.ts`. The runner and the CI jobs that run these gates: [tier-2-runner-and-ci.md](tier-2-runner-and-ci.md). diff --git a/context/dox/built/tier-6-runbooks.md b/context/dox/built/tier-6-runbooks.md index 84b970d0a..c83706178 100644 --- a/context/dox/built/tier-6-runbooks.md +++ b/context/dox/built/tier-6-runbooks.md @@ -25,7 +25,7 @@ Part of [built/index.md](index.md). The weekly sweep, deploy checks and Not doin - Dwell-ledger handles are 24px wide and lean 8px outward. - The light hero has its own `background-color`, because axe cannot read a `border-image` band. - The `/dox/` licence note lives inside the chat shell (`.gmt-hive-licence`); the Starlight footer omits it there. -- `a11y-axe` `color-contrast` (4.5:1) covers all text; the 7:1 house floor is a token rule (`--gmt-ice-dim` and the text tokens), kept by the token tests. +- `a11y-axe` `color-contrast` (4.5:1) covers all text; the 7:1 house floor is a token rule. The token tests hold `--gmt-ice`, `--gmt-cyan-ink` and the syntax roles at 7:1 (`text-contrast.test.ts`, `code-themes.test.ts`) and the globe inks (`globe-contrast.test.ts`). No test holds `--gmt-ice-dim` at 7:1 on every surface. ## Run the gates diff --git a/context/dox/tracker.md b/context/dox/tracker.md index 36a7d50f5..1add718bc 100644 --- a/context/dox/tracker.md +++ b/context/dox/tracker.md @@ -52,6 +52,7 @@ builds it. | 36 | DOX-G17 | — | #559 | Done | | 37 | DOX-G18 | — | #583 | Done | | 38 | DOX-G19 | — | #593 | Done | +| 39 | DOX-G20 | — | #592 | Done | Owed verification, not work: diff --git a/scripts/lib/affected.mjs b/scripts/lib/affected.mjs index fa5e914bb..25ff92a18 100644 --- a/scripts/lib/affected.mjs +++ b/scripts/lib/affected.mjs @@ -260,7 +260,7 @@ export const RULES = [ checks: [], }, { - test: /^(?:AGENTS\.md|CLAUDE\.md|PUBLISHING\.md|SECURITY\.md|\.gitignore|\.fallowrc\.jsonc|\.oxfmtrc\.json|context7\.json|skills-lock\.json|pyproject\.toml|uv\.lock|tsconfig\.json|vitest\.config\.ts)$/, + test: /^(?:ACCESSIBILITY\.md|AGENTS\.md|CLAUDE\.md|PUBLISHING\.md|SECURITY\.md|\.gitignore|\.fallowrc\.jsonc|\.oxfmtrc\.json|context7\.json|skills-lock\.json|pyproject\.toml|uv\.lock|tsconfig\.json|vitest\.config\.ts)$/, checks: [], }, { test: /^\.github\//, checks: [] }, diff --git a/scripts/lib/pr-meta-plan.mjs b/scripts/lib/pr-meta-plan.mjs index dbd2da84d..3f193c6c3 100644 --- a/scripts/lib/pr-meta-plan.mjs +++ b/scripts/lib/pr-meta-plan.mjs @@ -29,11 +29,11 @@ export const PATH_RULES = [ { /* Every root file that is not a document or an agent file is tooling. */ label: "gmt monorepo", - test: /^(?:scripts\/|apps\/dox\/scripts\/|\.github\/(?!workflows\/)|\.vscode\/|\.changeset\/(?:config\.json|README\.md)$|(?!(?:AGENTS|CLAUDE|CONTRIBUTING|PUBLISHING|README|SECURITY)\.md$|LICENSE$)[^/]+$)/, + test: /^(?:scripts\/|apps\/dox\/scripts\/|\.github\/(?!workflows\/)|\.vscode\/|\.changeset\/(?:config\.json|README\.md)$|(?!(?:ACCESSIBILITY|AGENTS|CLAUDE|CONTRIBUTING|PUBLISHING|README|SECURITY)\.md$|LICENSE$)[^/]+$)/, }, { label: "documentation", - test: /^(?:context\/(?!skills\.md$)|apps\/dox\/(?!scripts\/)|docs\/|README\.md$|CONTRIBUTING\.md$|PUBLISHING\.md$|SECURITY\.md$|(?:[^/]+\/)*LICENSE$|packages\/[\w-]+\/README\.md$)/, + test: /^(?:context\/(?!skills\.md$)|apps\/dox\/(?!scripts\/)|docs\/|ACCESSIBILITY\.md$|README\.md$|CONTRIBUTING\.md$|PUBLISHING\.md$|SECURITY\.md$|(?:[^/]+\/)*LICENSE$|packages\/[\w-]+\/README\.md$)/, }, ]; From df6a63d99f956a01795bf2986c3bddbe2efcfc42 Mon Sep 17 00:00:00 2001 From: "Craig C." Date: Mon, 30 Nov 2026 21:07:17 +0200 Subject: [PATCH 2/3] docs(dox): give the barrier route an email, and link the statement from the site (DOX-G20, #592) --- .changeset/accessibility-statement.md | 2 +- ACCESSIBILITY.md | 11 ++++-- apps/dox/src/components/Footer.astro | 24 ++++++++----- .../components/ask/ChatInfo.render.test.tsx | 18 +++++++++- apps/dox/src/components/ask/ChatInfo.tsx | 14 +++++++- .../ask/DoxChat.ssr-markup.test.tsx | 20 +++++++++++ apps/dox/src/components/ask/DoxPage.tsx | 9 +++-- apps/dox/src/components/slides/slides.css | 4 +-- .../src/lib/accessibility-statement.test.ts | 34 +++++++++++++++++++ apps/dox/src/lib/accessibility-statement.ts | 10 ++++++ apps/dox/src/lib/data-credits.test.ts | 23 +++++++++++++ apps/dox/src/lib/data-credits.ts | 16 +++++++++ apps/dox/src/lib/globe-credits.test.ts | 18 ++++++++++ apps/dox/src/lib/globe-mount.ts | 9 ++++- apps/dox/src/styles/gmt-hive.css | 2 +- apps/dox/src/styles/gmt-shell.css | 22 ++++++++++-- context/dox/built/tier-0-1-generator.md | 3 +- context/dox/built/tier-6-chat.md | 2 +- 18 files changed, 215 insertions(+), 26 deletions(-) create mode 100644 apps/dox/src/lib/accessibility-statement.test.ts create mode 100644 apps/dox/src/lib/accessibility-statement.ts diff --git a/.changeset/accessibility-statement.md b/.changeset/accessibility-statement.md index f803b3faa..2d0f4f799 100644 --- a/.changeset/accessibility-statement.md +++ b/.changeset/accessibility-statement.md @@ -1,4 +1,4 @@ --- --- -No release. The repo has an accessibility statement, `ACCESSIBILITY.md`, and an issue form for reporting a barrier on the docs site. +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/ACCESSIBILITY.md b/ACCESSIBILITY.md index 96a06f6c6..fa25e6707 100644 --- a/ACCESSIBILITY.md +++ b/ACCESSIBILITY.md @@ -3,6 +3,7 @@ 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 @@ -89,21 +90,27 @@ agents alike: 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 to say we have read it. +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). +[open an issue](https://github.com/northguild/gmt/issues/new/choose) or email the address above. 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. */}