Skip to content
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

TCCP: Add tooltip with purchase APR context #8483

Merged
merged 6 commits into from
Jun 25, 2024
Merged

TCCP: Add tooltip with purchase APR context #8483

merged 6 commits into from
Jun 25, 2024

Conversation

chosak
Copy link
Member

@chosak chosak commented Jun 21, 2024

To test, run a local server and visit http://localhost:8000/consumer-tools/credit-cards/explore-cards/cards/. Mouseover the question mark icon.

This implementation works without JavaScript but needs work for mobile. Placement also needs to be moved above the icon per latest design.

Screenshots

tooltip

Checklist

  • PR has an informative and human-readable title
    • PR titles are used to generate the change log in releases; good ones make that easier to scan.
    • Consider prefixing, e.g., "Mega Menu: fix layout bug", or "Docs: Update Docker installation instructions".
  • Changes are limited to a single goal (no scope creep)
  • Code follows the standards laid out in the CFPB development guidelines
  • Future todos are captured in comments and/or tickets
  • Project documentation has been updated, potentially one or more of:
    • This repo’s docs (edit the files in the /docs folder) – for basic, close-to-the-code docs on working with this repo
    • CFGOV/platform wiki on GHE – for internal CFPB developer guidance
    • CFPB/hubcap wiki on GHE – for internal CFPB design and content guidance

Front-end testing

Browser testing

Check the current browser support cutoff list](https://cfpb.github.io/consumerfinance.gov/browser-support#current-browser-support-metrics) for browsers that are advisable
to prioritize for testing.

Accessibility

  • Keyboard friendly (navigable with tab, space, enter, arrow keys, etc.)
  • Screen reader friendly
  • Does not introduce new errors or warnings in WAVE

Other

  • Is useable without CSS
  • Is useable without JS
  • Does not introduce new lint warnings
  • Flexible from small to large screens

@caheberer
Copy link
Member

I realize that my original mock-up was using the black with reversed type, but I was thinking we'd follow the style Grad path developed so that we were consistent. Which is gray-5 background with gray-40 border.

@chosak
Copy link
Member Author

chosak commented Jun 21, 2024

@caheberer colors updated in latest commit:

image

@caheberer
Copy link
Member

caheberer commented Jun 21, 2024

Thanks for the colors update!

Other design tweaks for @contolini

  • Add 15px spacing between header and body
  • Add caret

Do we want to expand the width of this so that it takes up less vertical space? I was using two columns (full width on mobile). It doesn't save that much room, so if there's a reason it's this size that's okay too.

@contolini
Copy link
Member

@caheberer here's the latest updates that I added to this PR. LMK if you want me to reduce the outer padding.

dates eligibility
Screenshot 2024-06-25 at 4 28 08 PM Screenshot 2024-06-25 at 4 28 14 PM

chosak and others added 5 commits June 25, 2024 16:44
To test, run a local server and visit
http://localhost:8000/consumer-tools/credit-cards/explore-cards/cards/.
Mouseover the question mark icon.

This implementation works without JavaScript but needs work for mobile.
Placement also needs to be moved above the icon per latest design.
Installs a small third-party JS library called tippy.js to assist
with accessible tooltips. Also adds a CFPB theme for the tooltips.

See https://kabbouchi.github.io/tippyjs-v4-docs/
TCCP tooltips are children of anchor tags so tapping them causes the
link to be followed instead of showing the tooltip. The anchors are
now checked to see if a tooltip is the event.target and ignored if so.
@contolini contolini marked this pull request as ready for review June 25, 2024 21:01
Copy link
Member

@contolini contolini left a comment

Choose a reason for hiding this comment

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

Merging in preparation for user testing. Further improvements TBD.

@contolini contolini added this pull request to the merge queue Jun 25, 2024
@contolini contolini removed this pull request from the merge queue due to a manual request Jun 25, 2024
@contolini contolini enabled auto-merge June 25, 2024 21:07
@contolini contolini added this pull request to the merge queue Jun 25, 2024
Merged via the queue into main with commit e4ba4de Jun 25, 2024
17 checks passed
@contolini contolini deleted the tccp/tooltips branch June 25, 2024 21:31
@caheberer
Copy link
Member

caheberer commented Jun 26, 2024

Looks good to me! One tiny thing that doesn't need to happen before testing—could we add a line break before the date range on mobile?

@contolini
Copy link
Member

@caheberer Yeah most def

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.

None yet

3 participants