-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[To Main] DESENG-630 - Create header section for new engagement page #2539
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2539 +/- ##
=======================================
Coverage 75.97% 75.98%
=======================================
Files 603 603
Lines 21784 21800 +16
Branches 1671 1678 +7
=======================================
+ Hits 16551 16564 +13
- Misses 4970 4974 +4
+ Partials 263 262 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! I always appreciate your attention to detail when it comes to the user experience.
Let's discuss a few things related to accessibility. We can chat further if you like but I think we should:
- remove the header tag from the hero image section (make it a labelled section instead)
- not open an external link for the CTA
I'd also be curious what the screen reader experience is like for the a tag with a button inside it. If the button is just there for styling then I'd probably recommend we remove it in favour of styling the a tag, but curious to hear why it's there
tabIndex={-1} | ||
target={isExternalCTA ? '_blank' : undefined} | ||
> | ||
<Button |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this button in here purely for styling? So that the link appears as a Met Design system button?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes; I prefer using anchor elements for navigation where possible because it helps communicate the intended location to the user. For example, using an onclick => navigate() call does not display the URL on hover. Users can also control-click anchors to open links in a new tab if they choose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nat and I discussed this offline: I still feel we should use anchor tags. Nat may try to use the MUI button api to make it an anchor tag to remedy this
<a | ||
href={engagement.cta_url || '#cta-section'} | ||
tabIndex={-1} | ||
target={isExternalCTA ? '_blank' : undefined} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was there specific direction on opening external links in new tabs? From WCAG, "In general, it is better not to open new windows and tabs since they can be disorienting for people, especially people who have difficulty perceiving visual content..."
If we must open in a new tab, we should tell people we're going to do so. One idiomatic way to do this is with an external link icon.
For more info, see: https://www.w3.org/TR/WCAG20-TECHS/G200.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I recieved specific directions from UX to open external URLs in new tabs. I believe this is so the user doesn't lose their spot in the app. For internal (anchor) links, there is no new tab behaviour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After some discussion with Jess and Nat, we'll be opening the link in the same tab, per accessibility guidelines
iconPosition="right" | ||
sx={{ borderRadius: '8px' }} | ||
> | ||
{engagement.cta_message || 'Learn more'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice attention to detail with the fallback message!
|
||
export const ViewEngagement = () => { | ||
const { slug, language } = useParams(); | ||
const oldLink = `/${slug}/${language}`; | ||
const { engagement } = useLoaderData() as { engagement: Engagement }; | ||
return ( | ||
<> | ||
<header> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a <header></header>
is adjacent to the main
tag, screen readers consider it a "banner" landmark. This means that most users will expect it to contain the site logo, site search tool, and maybe a navigation bar. I'd recommend just sticking with the existing section
tag as far as semantic HTML goes.
https://www.w3.org/WAI/ARIA/apg/patterns/landmarks/examples/banner.html
<section id="cta-section"> | ||
{/* TODO: create dark theme provider for this area*/} | ||
<BodyText sx={{ color: colors.surface.white }}> | ||
You are viewing a <b>preview</b> of the new engagement page. It will replace the old page |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's nice that you added this in case users find this and get confused :)
@@ -79,6 +86,17 @@ export const EngagementView = () => { | |||
<Grid item xs={12}> | |||
<EngagementBanner /> | |||
</Grid> | |||
{!isLoggedIn && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maintaining a nice user experience while we're renovating :)
<Route path=":slug/:language" element={<ViewEngagement />} /> | ||
<Route | ||
path=":slug/:language" | ||
loader={async ({ params }: { params: Params<string> }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice - starting to implement loaders!
Co-authored-by: Baelx <[email protected]>
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all the changes!
<a | ||
href={engagement.cta_url || '#cta-section'} | ||
tabIndex={-1} | ||
target={isExternalCTA ? '_blank' : undefined} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After some discussion with Jess and Nat, we'll be opening the link in the same tab, per accessibility guidelines
Issue #: 🎟️ DESENG-630
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the met-public license (Apache 2.0).