Draft: ADA-234: Ensure that the page, or at least one of its frames contains a level-one heading#63
Conversation
awilfox
requested changes
Aug 2, 2025
Member
awilfox
left a comment
There was a problem hiding this comment.
I have left some inline comments.
Overall, I sort of wish that Blacklight (especially GeoBlacklight) had an easier way of extracting the page title and rendering it to the h1 element. Alas, this will have to do.
| <%= render partial: 'shared/header_navbar' %> | ||
| <main id="main-container" class="<%= container_classes %>" role="main" aria-label="<%= t('blacklight.main.aria.main_container') %>"> | ||
| <%= content_for(:container_header) %> | ||
| <span class="constraints-label sr-only visually-hidden"><%= t('blacklight.search.filters.title') %></span> |
Member
There was a problem hiding this comment.
This line shouldn't be here; it causes "You searched for:" to appear on every page, even pages that aren't search-related.
Suggested change
| <span class="constraints-label sr-only visually-hidden"><%= t('blacklight.search.filters.title') %></span> |
Contributor
Author
There was a problem hiding this comment.
Good catch, I'll remove it.
Comment on lines
+50
to
+53
| <%= content_for(:container_header) || content_tag(:div, class: "sr-only visually-hidden-focusable") do | ||
| content_tag(:h1, "Main Content") + | ||
| content_tag(:h2, "Section Content") | ||
| end %> |
Member
There was a problem hiding this comment.
- Should not be marked 'focusable'.
- The h2 is unnecessary.
- The h1 should describe the page, not just say "main content"; since this is a fallback, it can be the name of the site.
Suggested change
| <%= content_for(:container_header) || content_tag(:div, class: "sr-only visually-hidden-focusable") do | |
| content_tag(:h1, "Main Content") + | |
| content_tag(:h2, "Section Content") | |
| end %> | |
| <%= content_for(:container_header) || content_tag(:div, class: "sr-only visually-hidden") do | |
| content_tag(:h1, "UC Berkeley Library GeoData") | |
| end %> |
Contributor
Author
There was a problem hiding this comment.
- I remove 'focusable', yes, it seems we do not need it.
- The
<h2>was included inbase.html.erbto solve header accessible warning on home page, I updated the code so it only apply to the home page now. - Geoblacklight does provide dynamic titles, I updated them to the header.
awilfox
reviewed
Aug 5, 2025
Comment on lines
+50
to
+54
| if render_page_title == "UC Berkeley GeoData" | ||
| content_tag(:h1, render_page_title) + content_tag(:h2, render_page_title + " Categories") | ||
| else | ||
| content_tag(:h1, render_page_title) | ||
| end |
Member
There was a problem hiding this comment.
It might have been slightly more efficient to do
content_tag(:h1, render_page_title)
content_tag(:h2, render_page_title + " Categories") if render_page_title == "UC Berkeley GeoData"
Contributor
Author
There was a problem hiding this comment.
Thanks, but this won't work.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.