diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e3d2bbb0..4e8a81395 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -259,7 +259,7 @@ jobs: - name: Run Playwright tests run: | chmod +x "${{ runner.temp }}/sqlpage-bin/sqlpage" - SQLPAGE_BINARY="${{ runner.temp }}/sqlpage-bin/sqlpage" npx playwright test + AXE_FIXTURES=1 SQLPAGE_BINARY="${{ runner.temp }}/sqlpage-bin/sqlpage" npx playwright test - uses: actions/upload-artifact@v7 if: ${{ !cancelled() }} with: diff --git a/AGENTS.md b/AGENTS.md index 17706edd9..1331baa25 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -32,9 +32,9 @@ reference material in the official documentation site. Do not duplicate it here. ## Changes and validation -Keep changes scoped to the task, including formatting. Reuse existing tests and -parameterize repeated setup without removing assertions or scenarios. Run the -relevant tests and the formatting/lint checks in CONTRIBUTING.md before stopping. +Keep edits and formatting scoped. Reuse test setup and preserve distinct scenarios. +Test observable behavior through public interfaces. Avoid internal markup and state. +Run the relevant tests and formatting/lint checks in CONTRIBUTING.md. Report unavailable checks and failures accurately; a test summary followed by a hung process is a failure. diff --git a/CHANGELOG.md b/CHANGELOG.md index badfbe04d..e35b2edc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## unreleased +- Standard alert descriptions have higher text contrast. - An `alert` without `color` uses the info color again, and its `role` attribute no longer starts with a space. ([#1697](https://github.com/sqlpage/SQLPage/issues/1697)) - New `create_new_text` and `no_results_text` properties on `select` fields translate the dropdown texts "Add …" and "No results found". The row that creates a new value is now announced by screen readers when it is the active option. ([#1699](https://github.com/sqlpage/SQLPage/issues/1699)) - The `table` component can fetch and display HTML fragments in selected columns using `embed`. @@ -15,6 +16,7 @@ - Disabled buttons expose their state to assistive technology and cannot be activated. - Tracking blocks without links now expose their titles to screen readers. - The `shell` sidebar now uses `navbar_title` and preserves the colors of the supplied logo in dark mode. +- Keyboard users no longer encounter empty home links in the `shell` navigation. Logo-only home links have an accessible name. - Chart export menus, tooltips, and series colors now follow the theme surrounding each chart, including in custom shells. Chart labels on colored marks have a contrasting outline that carries over to SVG downloads. - Map marker popups follow the surrounding theme so their titles and links stay readable. Map attribution links are underlined. - Each `login` component’s labels target its own fields. Set `false AS autofocus` to keep the username field from taking focus when the page opens. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ee28efe42..8c5861f8e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -74,6 +74,8 @@ template properties. Run `npx playwright test --grep @accessibility` from `tests/end-to-end` to audit the official site's component documentation and its live examples in SQLPage's stock light and dark themes with axe-core. The normal Playwright suite also runs it. +CI also audits each browser fixture's initial page once. Run that project locally +with `AXE_FIXTURES=1 npx playwright test --project=fixture-accessibility`. To show that an issue exists before you fix it, put the reproduction in a fixture and run it against releases with one command, such as `nix run .#reproduce -- repro_721 postgres v0.35.0 v0.36.1 tree`. The second argument is `sqlite` or `postgres`, and `tree` is your working tree. It prints Playwright's output for each version, then a table you can paste into the issue or pull request. Releases run from their Docker images, from v0.29.0 onwards, and Postgres from `docker compose`. Without Nix, run `npm run reproduce --` in `tests/end-to-end` instead. diff --git a/examples/official-site/sqlpage/migrations/01_documentation.sql b/examples/official-site/sqlpage/migrations/01_documentation.sql index 9063fa289..31cd392cd 100644 --- a/examples/official-site/sqlpage/migrations/01_documentation.sql +++ b/examples/official-site/sqlpage/migrations/01_documentation.sql @@ -1549,7 +1549,7 @@ INSERT INTO parameter(component, name, description, type, top_level, optional) S ('theme', 'Set to "dark" to use a dark theme.', 'TEXT', TRUE, TRUE), ('footer', 'Muted text to display in the footer of the page. This can be used to display a link to the terms and conditions of your application, for instance. By default, shows "Built with SQLPage". Supports links with markdown.', 'TEXT', TRUE, TRUE), ('preview_image', 'The URL of an image to display as a link preview when the page is shared on social media', 'URL', TRUE, TRUE), - ('navbar_title', 'The title shown in the navigation bar or sidebar. Defaults to the page title. Set an empty string to show just the logo.', 'TEXT', TRUE, TRUE), + ('navbar_title', 'The title shown in the navigation bar or sidebar. Defaults to the page title. Set an empty string to show just the logo, if configured. With neither a navigation title nor a logo, there is no home link in the navigation bar.', 'TEXT', TRUE, TRUE), ('target', 'Where the menu items should open: "_blank" for a new tab, "_self" for the same tab, "_parent" for the parent frame, or "_top" for the full body of the window. Set it inside a "menu_item" json object; it has no effect when set directly on the shell.', 'TEXT', TRUE, TRUE), ('class', 'class attribute added to the page''s html element. It can be used to apply custom styling to the whole page through css.', 'TEXT', TRUE, TRUE) ) x; diff --git a/examples/official-site/sqlpage/migrations/03_alert_component.sql b/examples/official-site/sqlpage/migrations/03_alert_component.sql index f1c663a82..7fd2ee908 100644 --- a/examples/official-site/sqlpage/migrations/03_alert_component.sql +++ b/examples/official-site/sqlpage/migrations/03_alert_component.sql @@ -32,7 +32,7 @@ VALUES ( ( 'alert', 'color', - 'The color theme for the alert message.', + 'The color theme for the alert message. The default is `info`.', 'COLOR', TRUE, TRUE diff --git a/frontend/src/sqlpage.css b/frontend/src/sqlpage.css index 031fbce0b..d22f044b1 100644 --- a/frontend/src/sqlpage.css +++ b/frontend/src/sqlpage.css @@ -3,6 +3,10 @@ --tblr-navbar-color: rgba(var(--tblr-body-color-rgb), 0.8); } +.alert-description { + color: var(--tblr-body-color); +} + [data-bs-theme="dark"] .alert:not(.alert-important) { /* See https://github.com/tabler/tabler/issues/1607 */ background-color: var(--tblr-bg-surface); diff --git a/sqlpage/templates/shell.handlebars b/sqlpage/templates/shell.handlebars index deb86cefd..001f35a75 100644 --- a/sqlpage/templates/shell.handlebars +++ b/sqlpage/templates/shell.handlebars @@ -174,15 +174,17 @@ - + {{#if (any image icon (default navbar_title title))}} + {{#if image}} - {{#unless (default navbar_title title)}}{{default title 'Home'}}{{/unless}} + {{/if}} {{#if icon}} {{~icon_img icon~}} {{/if}} {{default navbar_title title}} + {{/if}} @@ -191,16 +193,20 @@ {{else}}