Skip to content

"Get Weekly Digests" pattern - #1679

Merged
gerardo-rodriguez merged 96 commits into
v-nextfrom
feature/disclosure-widget
Mar 25, 2022
Merged

"Get Weekly Digests" pattern#1679
gerardo-rodriguez merged 96 commits into
v-nextfrom
feature/disclosure-widget

Conversation

@gerardo-rodriguez

@gerardo-rodriguezgerardo-rodriguez commented Mar 15, 2022

Copy link
Copy Markdown
Member

Overview

This PR introduces a Subscription Choices component.

  • It includes an embedded Button Swap component for the "Get Notifications" button
  • It shows/hides the email subscription form

Screenshots

demo

Testing

Preview: https://deploy-preview-1679--cloudfour-patterns.netlify.app/?path=/story/components-subscribe--default-story

Accessibility

  • Confirm you can use the keyboard to navigate to and away from the form
  • There should not be a form hide delay when tabbing backward from the form to the "Get Weekly Digests" link
  • There should be a form hide delay when you tab forward out of the form
  • Confirm VoiceOver + Safari experience is accessible

General

With both keyboard and mouse inputs, clicking/activating the "Get Weekly Digests" link should:

  • Reveal the form over the controls
  • Set the :focus onto the email input field

If the form is visible, hitting Escape on the keyboard should:

  • Hide the form
  • Move the :focus to the "Get Weekly Digests" link

Theming

  • Confirm the form background color looks correct in each theme.

Known issues

I was unable to figure out how to set the form background color for the "dark alternate" theme. Any ideas @tylersticka? (This has been resolved)

Screen Shot 2022-03-22 at 8 26 12 AM


@changeset-bot

changeset-botBot commented Mar 15, 2022

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c9216fd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
NameType
@cloudfour/patternsMinor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@gerardo-rodriguezgerardo-rodriguez self-assigned this Mar 15, 2022
@netlify

netlifyBot commented Mar 15, 2022

Copy link
Copy Markdown

Deploy Preview for cloudfour-patterns ready!

NameLink
🔨 Latest commitc9216fd
🔍 Latest deploy loghttps://app.netlify.com/sites/cloudfour-patterns/deploys/623cd3e6ea84500008878540
😎 Deploy Previewhttps://deploy-preview-1679--cloudfour-patterns.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@gerardo-rodriguezgerardo-rodriguez changed the title WIP"Get Weekly Digests" patternMar 16, 2022
heading "Get Weekly Digests"
text "Get Weekly Digests"
text "Email"
textbox

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

I switched to using the Input Group with an Input component and this value changed. Before when I was using a vanilla <input>, it read textbox "Email". Now it only reads textbox. The "name" value seems to have gone away?

I reviewed both the vanilla and Input Group with the Input component and I was unable to notice a difference in the markup so I'm not sure why this changed. 🤔

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@gerardo-rodriguez I tried to debug this locally, I logged the markup using:

console.log(awaitpage.evaluate(()=>document.body.innerHTML));

right before the snapshot.

It looks like the id/for attributes aren't getting set correctly.

<labelclass="c-subscribe__form-input-label" for="subscription-email-">
Email
</label><divclass="o-input-group c-subscribe__form-input-group"><inputtype="email" class="c-input c-subscribe__form-input" id="subscription-email-null" placeholder="Your Email Address" autocomplete="home email" required="">

Looks like we are missing the form_id prop?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

I logged the markup using

Great idea! We should add this “recipe” tip somewhere in the Pleasantest docs. It wasn’t obvious I could do that. LOL

Looks like we are missing the form_id prop?

Oh, odd! Let’s create a GH issue for this. Can you help me with that? If not, no worries, I can do so later this morning.

Thanks for following up, @calebeby!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@gerardo-rodriguez

gerardo-rodriguez commented Mar 24, 2022

Copy link
Copy Markdown
MemberAuthor

@tylersticka@spaceninja I'm not sure why CI isn't running after my last commit, but this PR is ready for another review! I have addressed all feedback.

I did leave a question for@calebeby, but I don't think that's a blocker for this PR.

Comment threadsrc/components/subscribe/subscribe.scss Outdated
Comment threadsrc/objects/input-group/input-group.twig Outdated
Comment threadsrc/components/subscribe/subscribe.twig Outdated
Comment threadsrc/components/subscribe/subscribe.twig Outdated
gerardo-rodriguezand others added 10 commits March 24, 2022 11:54
Co-authored-by: Tyler Sticka <tyler@cloudfour.com>
Co-authored-by: Tyler Sticka <tyler@cloudfour.com>
…dfour.com-patterns into feature/disclosure-widget
* 'feature/disclosure-widget' of github.com:cloudfour/cloudfour.com-patterns:
Update src/objects/input-group/input-group.twig
Update src/components/subscribe/subscribe.twig
@gerardo-rodriguez

Copy link
Copy Markdown
MemberAuthor

@tylersticka Thanks for your feedback! 🎉

I have addressed the latest round of feedback. 😉

@tylerstickatylersticka left a comment

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.

LGTM, will defer approval to @cloudfour/dev since I feel less qualified to review the JS and testing stuff!

@gerardo-rodriguez

Copy link
Copy Markdown
MemberAuthor

@calebeby@spaceninja Can either of you help out with a final dev review? Thank you!

@gerardo-rodriguez
gerardo-rodriguez requested a review from a teamMarch 25, 2022 17:26

@spaceninjaspaceninja left a comment

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.

Code looks good, and works as described :shipit:

@gerardo-rodriguez
gerardo-rodriguez merged commit fc595a8 into v-nextMar 25, 2022
@gerardo-rodriguez
gerardo-rodriguez deleted the feature/disclosure-widget branch March 25, 2022 21:45
@github-actionsgithub-actionsBot mentioned this pull request Mar 25, 2022
Sign up for freeto 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.

Get Weekly Digests pattern

4 participants

@gerardo-rodriguez@calebeby@tylersticka@spaceninja