Skip to content

Draft: ADA-234: Ensure that the page, or at least one of its frames contains a level-one heading#63

Merged
yzhoubk merged 5 commits intomainfrom
ADA-234
Aug 4, 2025
Merged

Draft: ADA-234: Ensure that the page, or at least one of its frames contains a level-one heading#63
yzhoubk merged 5 commits intomainfrom
ADA-234

Conversation

@yzhoubk
Copy link
Copy Markdown
Contributor

@yzhoubk yzhoubk commented Jul 31, 2025

No description provided.

@yzhoubk yzhoubk marked this pull request as ready for review August 1, 2025 17:26
@yzhoubk yzhoubk requested a review from awilfox August 1, 2025 17:27
Copy link
Copy Markdown
Member

@awilfox awilfox left a comment

Choose a reason for hiding this comment

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

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>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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 %>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  1. Should not be marked 'focusable'.
  2. The h2 is unnecessary.
  3. 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 %>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

  1. I remove 'focusable', yes, it seems we do not need it.
  2. The <h2> was included inbase.html.erb to solve header accessible warning on home page, I updated the code so it only apply to the home page now.
  3. Geoblacklight does provide dynamic titles, I updated them to the header.

@yzhoubk yzhoubk merged commit 12ea523 into main Aug 4, 2025
2 checks passed
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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks, but this won't work.

@anarchivist anarchivist deleted the ADA-234 branch January 14, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants