Skip to content

Fix TOTP informational tooltip using design system tooltip#4529

Closed
aduth wants to merge 5 commits intomasterfrom
aduth-help-tooltip
Closed

Fix TOTP informational tooltip using design system tooltip#4529
aduth wants to merge 5 commits intomasterfrom
aduth-help-tooltip

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented Dec 23, 2020

Relates to: LG-3756

Why:

  • Corrects an issue where the tooltip trigger was invisible
  • Favor design system over custom implementation where possible
  • As part of LG-3756, eliminate unnecessary dependencies (hint.css)

Screen Recordings:

Before:

tooltip-before.mov

After:

tooltip-after.mov

Relevant resources:

As an alternative approach, we may consider to remove this altogether, favoring to show the content static in the page if it's relevant for login. In this alternative, we could remove all tooltips dependencies altogether (see related Slack thread).

**Why**:

- Corrects an issue where the tooltip trigger was invisible
- Favor design system over custom implementation where possible
- As part of LG-3756, eliminate unnecessary dependencies (hint.css)
Comment on lines +16 to +29
<svg
xmlns="http://www.w3.org/2000/svg"
width="20"
height="20"
viewBox="0 0 24 24"
role="img"
alt=""
class="help-tooltip__icon"
>
<path
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"
fill="currentColor"
></path>
</svg>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

FYI this is sourced from USWDS, but we've once again fallen behind, and this is available in USWDS 2.10.0 (we're at 2.9.0).

Source: https://designsystem.digital.gov/components/icons/

Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

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

LGTM, some comments, no blockers

@aduth
Copy link
Contributor Author

aduth commented Dec 28, 2020

From some related discussion in Slack, it may just be that we want to remove this tooltip altogether.

aduth added a commit that referenced this pull request Dec 28, 2020
**Why**:

- It is currently broken, displaying as non-visible except by cursor hover or keyboard focus.
- It's the only instance of a tooltip in the entire application.
- Tooltips are not ideal for longer-form content like the informational text we show in this tooltip
  - See: https://designsystem.digital.gov/components/tooltip/
- We are not space-constrained on this page and could show informational text as part of the primary content
- Fewer dependencies for us to manage
  - If we were to want tooltips, we should ideally be using USWDS tooltips (see #4529) to consolidate dependencies
- Less styles for the user to download (faster load time)
@aduth
Copy link
Contributor Author

aduth commented Dec 28, 2020

From some related discussion in Slack, it may just be that we want to remove this tooltip altogether.

Closing in favor of removal: #4535

This can still serve as reference work if / when we want to introduce a tooltip. The styles for assigning width of the tooltip should ideally not be necessary or desirable, since they were only required to accommodate the longer-form content of the TOTP tooltip text. As mentioned in #4535, we shouldn't want to use tooltips for long text, and thus the styles wouldn't be necessary.

@aduth aduth closed this Dec 28, 2020
@aduth aduth deleted the aduth-help-tooltip branch December 28, 2020 16:23
aduth added a commit that referenced this pull request Dec 28, 2020
**Why**:

- It is currently broken, displaying as non-visible except by cursor hover or keyboard focus.
- It's the only instance of a tooltip in the entire application.
- Tooltips are not ideal for longer-form content like the informational text we show in this tooltip
  - See: https://designsystem.digital.gov/components/tooltip/
- We are not space-constrained on this page and could show informational text as part of the primary content
- Fewer dependencies for us to manage
  - If we were to want tooltips, we should ideally be using USWDS tooltips (see #4529) to consolidate dependencies
- Less styles for the user to download (faster load time)
aduth added a commit that referenced this pull request Dec 29, 2020
**Why**: As a user, I want login.gov to not have unused or out of date apps, so that I can use the fastest and most secure app possible.

Lower-risk than bumping major packages, which may warrant updates in individualized pull requests.

Excludes `hint.css` as this will be addressed separately, either by using USWDS (#4529) or removing tooltips altogether.

Specifics:

cleave.js

- Changelog: https://github.com/nosir/cleave.js/releases
- Testing: Check that auto-formatted fields (SSN, TOTP, etc) continue to work as expected

focus-trap

- Changelog: https://github.com/focus-trap/focus-trap/blob/master/CHANGELOG.md
- Testing: Check that session timeout modal and IAL2 Acuant mobile capture continue to trap focus and work as expected

libphonenumber-js

- Changelog: https://gitlab.com/catamphetamine/libphonenumber-js/-/blob/master/CHANGELOG.md
- Testing: Check that phone number validation when adding a phone number continues to validate numbers correctly
aduth added a commit that referenced this pull request Dec 29, 2020
**Why**: As a user, I want login.gov to not have unused or out of date apps, so that I can use the fastest and most secure app possible.

Lower-risk than bumping major packages, which may warrant updates in individualized pull requests.

Excludes `hint.css` as this will be addressed separately, either by using USWDS (#4529) or removing tooltips altogether.

Specifics:

cleave.js

- Changelog: https://github.com/nosir/cleave.js/releases
- Testing: Check that auto-formatted fields (SSN, TOTP, etc) continue to work as expected

focus-trap

- Changelog: https://github.com/focus-trap/focus-trap/blob/master/CHANGELOG.md
- Testing: Check that session timeout modal and IAL2 Acuant mobile capture continue to trap focus and work as expected

libphonenumber-js

- Changelog: https://gitlab.com/catamphetamine/libphonenumber-js/-/blob/master/CHANGELOG.md
- Testing: Check that phone number validation when adding a phone number continues to validate numbers correctly
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