LG-7949: Change behavior of "skip to content link" on account page#7310
LG-7949: Change behavior of "skip to content link" on account page#7310
Conversation
This reverts commit 07e9eeb.
changelog: Improvements, Accessibility, Improve accessibility link (LG-7949)
d6a77b3 to
3fb5bc8
Compare
|
|
||
| <% if IdentityConfig.store.newrelic_browser_key.present? && IdentityConfig.store.newrelic_browser_app_id.present? %> | ||
| <%= render 'shared/newrelic/browser_instrumentation' %> | ||
| <%= render 'shared/newrelic/browser_instrumentation' %> |
There was a problem hiding this comment.
❤️ thanks for fixing this indentation while we're here!
app/views/layouts/base.html.erb
Outdated
| <%= content_tag(local_assigns[:custom_main].present? ? 'div' : 'main', { class: 'site-wrap bg-primary-lighter', id: local_assigns[:custom_main].present? ? 'main-wrapper' : 'main-content' }) do %> | ||
| <div class="grid-container padding-y-4 tablet:padding-y-8 <%= local_assigns[:disable_card].present? ? '' : 'card' %>"> | ||
| <%= yield(:pre_flash_content) if content_for?(:pre_flash_content) %> | ||
| <%= render FlashComponent.new(flash: flash) %> | ||
| <%= content_for?(:content) ? yield(:content) : yield %> | ||
| </div> | ||
| <% end %> |
There was a problem hiding this comment.
looks like this has an indent by 4 instead of by 2? also maybe let's put the content_tag stuff on separate lines so it's easier to follow?
| <%= content_tag(local_assigns[:custom_main].present? ? 'div' : 'main', { class: 'site-wrap bg-primary-lighter', id: local_assigns[:custom_main].present? ? 'main-wrapper' : 'main-content' }) do %> | |
| <div class="grid-container padding-y-4 tablet:padding-y-8 <%= local_assigns[:disable_card].present? ? '' : 'card' %>"> | |
| <%= yield(:pre_flash_content) if content_for?(:pre_flash_content) %> | |
| <%= render FlashComponent.new(flash: flash) %> | |
| <%= content_for?(:content) ? yield(:content) : yield %> | |
| </div> | |
| <% end %> | |
| <%= content_tag( | |
| local_assigns[:custom_main].present? ? 'div' : 'main', | |
| class: 'site-wrap bg-primary-lighter', | |
| id: local_assigns[:custom_main].present? ? 'main-wrapper' : 'main-content' | |
| ) do %> | |
| <div class="grid-container padding-y-4 tablet:padding-y-8 <%= local_assigns[:disable_card].present? ? '' : 'card' %>"> | |
| <%= yield(:pre_flash_content) if content_for?(:pre_flash_content) %> | |
| <%= render FlashComponent.new(flash: flash) %> | |
| <%= content_for?(:content) ? yield(:content) : yield %> | |
| </div> | |
| <% end %> |
|
|
||
| <%= javascript_packs_tag_once('navigation') %> | ||
| <%= render template: 'layouts/base', locals: { disable_card: true } %> | ||
| <%= render template: 'layouts/base', locals: { disable_card: true, custom_main: true } %> |
There was a problem hiding this comment.
what if we named the argument use_main to indicate that the template should not have a <main> tag? (and flip the corresponding logic)
| <%= render template: 'layouts/base', locals: { disable_card: true, custom_main: true } %> | |
| <%= render template: 'layouts/base', locals: { disable_card: true, use_main: false } %> |
There was a problem hiding this comment.
another idea: user_main_tag: false ?
There was a problem hiding this comment.
I've just realized a different approach or more changes are necessary, as the rule https://dequeuniversity.com/rules/axe/4.3/region?application=axeAPI is violated.
A simple change would be to change how the line <%= link_to t('shared.skip_link'), '#main-content', class: 'usa-skipnav' %> works in the base layout. The id of #main-content could be changed by the layout file identity-idp/app/views/layouts/account_side_nav.html.erb.
Otherwise a bigger restructure of the layouts and accounts page seems to be necessary. The partial identity-idp/app/views/accounts/_side_nav.html.erb functions as a second nav. But this partial is nested [edit] outside of landmark tags in the current change.
There was a problem hiding this comment.
For the accessibility build failure, it looks like the only content which is not within a landmark is the top "Access your government benefits ..." content. It seems like it would be appropriate to mark this up as an <aside>, since it's content which complements the main content?
i.e. changing this element from <div> to <aside>:
There was a problem hiding this comment.
@zachmargolis I have made your suggested changes. But I find the name user_main_tag: false to be confusing, and I find the boolean check for false more difficult to read.
app/views/layouts/base.html.erb
Outdated
| </div> | ||
| </main> | ||
|
|
||
| <%= content_tag(local_assigns[:custom_main].present? ? 'div' : 'main', { class: 'site-wrap bg-primary-lighter', id: local_assigns[:custom_main].present? ? 'main-wrapper' : 'main-content' }) do %> |
There was a problem hiding this comment.
Since we're not using the main-wrapper ID for anything, could we avoid assigning the id for the custom main case?
| <%= content_tag(local_assigns[:custom_main].present? ? 'div' : 'main', { class: 'site-wrap bg-primary-lighter', id: local_assigns[:custom_main].present? ? 'main-wrapper' : 'main-content' }) do %> | |
| <%= content_tag(local_assigns[:custom_main] ? 'div' : 'main', { class: 'site-wrap bg-primary-lighter', id: local_assigns[:custom_main] ? nil : 'main-content' }) do %> |
|
As it stands, the skip link is only going to the main account content. We need to have it so that the user has the option to either skip to the main navigation, or the account preferences |
My understanding is that the ticket being addressed here is to resolve a bug with how "Skip to main content" operates, which currently does not work as expected, as it should bypass the repeated navigation elements. We could explore additional skip links, but this seems like a separate task, and may require more exploration to whether it helps more than it hurts. |
I can see the help/hurt concern. I am thinking of a case where someone would want to navigate to that menu and the only way to get to it at this point is to back tab through the first element, which is not a good experience. I would feel okay with this fix as it stands, but I would like a further discussion with IRS/other accessibility folks on the team to assess if my concern is valid. |
|
@jmdembe I raised your concerns when I started the ticket and again in the group meeting. As I understand it, others want the accessibility link to point to the "right hand side" of the main screen. If these changes are not desired, then the PR can be dropped. |
aduth
left a comment
There was a problem hiding this comment.
This LGTM as addressing the bug described in the ticket 👍
Separately, it seems like it'd be good to sync as a team on whether there's any action regarding navigating to page elements other than the main content. Can we discuss after standup tomorrow?
I am going to seek further clarification so that everyone is on the same page |
🎫 Ticket
LG-7949
🛠 Summary of changes
This PR changes the behavior of the accessibility link
Skip to main contenton the page/account.The layout found at
app/views/layouts/account_side_nav.html.erboverrides portions of the base layout. On the account page, the location of the tagmainis changed so that the accessibility linkSkip to main contentjumps to the desired location.Suggestions and improvements to these two conflicting layouts are welcome.