Skip to content

Update Settings page, use system name and language code; add a11y Copilot instructions.#18521

Open
gcamacho079 wants to merge 7 commits into6.xfrom
a11y/settings
Open

Update Settings page, use system name and language code; add a11y Copilot instructions.#18521
gcamacho079 wants to merge 7 commits into6.xfrom
a11y/settings

Conversation

@gcamacho079
Copy link
Contributor

@gcamacho079 gcamacho079 commented Mar 6, 2026

Test Criteria

  • The document title should include the system name (in addition to the current page title)
  • Every page (including pages where there's no currentUser) should include the language code on the html element
  • Settings link text should be "{{ page }} - Settings", where " - Settings" is visually-hidden and provided for context to prevent having the same link text as items in the main navigation; for example, this can be an issue with the "Assets" page or when custom navigation items have been defined.

Related issues

Resolves ACC-34

@gcamacho079 gcamacho079 added the accessibility 👤 features related to accessibility label Mar 6, 2026
@linear
Copy link

linear bot commented Mar 6, 2026

@gcamacho079 gcamacho079 changed the title A11y/settings Update Settings page, use system name and language code; add a11y Copilot instructions. Mar 7, 2026
@gcamacho079 gcamacho079 marked this pull request as ready for review March 7, 2026 19:29
@gcamacho079 gcamacho079 requested a review from Copilot March 7, 2026 19:29
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Control Panel’s Settings UX and global page metadata to improve accessibility and context, and adds repository Copilot guidance for building accessible UI.

Changes:

  • Append the system name to the document title via AppLayout.
  • Add the current language code to the root HTML <html lang="..."> and expose it in shared Inertia “craft” props.
  • Make Settings links unique for screen readers by adding a visually-hidden “ - Settings” suffix.
  • Add .github accessibility coding instructions for Copilot.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/Http/Middleware/HandleInertiaRequests.php Shares locale into view + adds craft.app.language Inertia prop.
resources/views/app.blade.php Sets <html lang> from a shared $language variable.
resources/js/pages/SettingsIndexPage.vue Adds visually-hidden “ - Settings” suffix to link text.
resources/js/layout/AppLayout.vue Computes and sets a full document title including system name.
.github/instructions/a11y.instructions.md Adds accessibility-focused Copilot instructions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="">
<html xmlns="http://www.w3.org/1999/xhtml" lang="{{ $language }}">
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

app.blade.php now expects $language, but HandleInertiaRequests::share() returns early when Craft isn’t installed, so $language will be undefined and the root Inertia view can error. Consider deriving lang directly in the Blade template (e.g., from app()->getLocale()), and normalize it to a valid BCP47 tag (replace _ with -) for the HTML lang attribute.

Suggested change
<html xmlns="http://www.w3.org/1999/xhtml" lang="{{ $language }}">
<html xmlns="http://www.w3.org/1999/xhtml" lang="{{ str_replace('_', '-', app()->getLocale() ?? 'en') }}">

Copilot uses AI. Check for mistakes.
const sidebarToggle = useTemplateRef('sidebarToggle');
const {announcement, announce} = useAnnouncer();
const fullPageTitle = computed(() => {
return `${props.title} - ${system.name}`;
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fullPageTitle will produce titles like "undefined - " when title isn’t passed (it’s optional). Suggest falling back to just system.name (or props.title ?? '' trimmed) so pages without a title don’t end up with "undefined" in the document title.

Suggested change
return `${props.title} - ${system.name}`;
const title = props.title?.trim();
return title ? `${title} - ${system.name}` : system.name;

Copilot uses AI. Check for mistakes.
@@ -19,6 +20,8 @@
{fullWidth: false, crumbs: () => []}
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

withDefaults() includes a crumbs default, but crumbs isn’t declared as a prop in defineProps<...>() and the layout reads breadcrumbs from page.props instead. This looks like dead/leftover config and can confuse future edits; either add the prop type if it’s intended to be a prop, or remove it from the defaults object.

Suggested change
{fullWidth: false, crumbs: () => []}
{fullWidth: false}

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility 👤 features related to accessibility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants