department-of-veterans-affairs / vets-design-system-documentation

Repository for design.va.gov website
https://design.va.gov
36 stars 55 forks source link

Enable Back to Top component to appear dynamically based on page height #2796

Open randimays opened 2 weeks ago

randimays commented 2 weeks ago

Bug Report

What happened

The existing guidance for the Back to top (BTT) component says that it should not be used on pages with dynamic content. This excludes quite a few pages (all Drupal pages), even when a BTT component would be helpful on those pages.

We have some examples of BTT being used on pages that have dynamic content:

This code and guidance likely predates most of us. But it's worth noting that our usage of the component is inconsistent, and it doesn't make sense to leave the decision of whether to include BTT to the individual page or the teams. We propose:

The Back to top component should appear dynamically (based on the page height).

If the BTT component can calculate when it should appear based on page height, we can then add the component to basic page templates, and remove the decision-making on when to add it from the teams.

Slack thread for context: https://dsva.slack.com/archives/C01DBGX4P45/p1714680374615469

What I expected to happen

I expect the BTT component to appear on every page of VA.gov where scrolling is needed.

Urgency

How urgent is this request? Please select the appropriate option below and/or provide details

Details

caw310 commented 1 day ago

Hey team! Please add your planning poker estimate with Zenhub @Andrew565 @ataker @harshil1793 @it-harrison @jamigibbs @micahchiang @nickjg231 @powellkerry @rmessina1010 @rsmithadhoc