Skip to content

Raise error when view missing title content block#9447

Merged
aduth merged 9 commits intomainfrom
aduth-try-forced-title
Oct 31, 2023
Merged

Raise error when view missing title content block#9447
aduth merged 9 commits intomainfrom
aduth-try-forced-title

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented Oct 25, 2023

🛠 Summary of changes

Updates base template to enforce the expectation that a controller view will assign a content_for(:title), to satisfy descriptive purpose requirements of WCAG SC 2.4.2 Page Titled, something we already partially enforce through accessibility matchers in specs

📜 Testing Plan

Build should pass.

Also verify that an error would occur when controller view doesn't include title, such as removing this line from the sign-in page:

<% title t('titles.visitors.index') %>

aduth added 2 commits October 25, 2023 09:40
changelog: Internal, Accessibility, Add enforcement for unique page titles
@aduth
Copy link
Contributor Author

aduth commented Oct 30, 2023

I think I've tackled the last of the missing titles in 2f7ff9d . For extra assurance, I also manually stepped through every file in app/views to double-check that every controller action view includes a <% title %> statement, as well as some of our base-layout-rendering partials.

I'll need to get a couple translations for the missing titles before this is fully ready.

@aduth aduth marked this pull request as ready for review October 31, 2023 12:23
@aduth aduth merged commit 4d69e9d into main Oct 31, 2023
@aduth aduth deleted the aduth-try-forced-title branch October 31, 2023 13:16
@amirbey amirbey mentioned this pull request Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants