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

UX issue: translator popup opens on every page load #11305

Closed
1 of 2 tasks
konopkja opened this issue Sep 28, 2023 · 10 comments
Closed
1 of 2 tasks

UX issue: translator popup opens on every page load #11305

konopkja opened this issue Sep 28, 2023 · 10 comments
Assignees
Labels
bug 🐛 Something isn't working dev required This requires developer resources help wanted Extra attention is needed or someone is needed to help medium priority This has a medium priority

Comments

@konopkja
Copy link
Contributor

Describe the bug

When I visit non-translated page on other than english page, I see a popup highliting translator program.

When I close this popup to keep reading the content and then go to another page on our domain, the popup appears again. If i close it again, it will show on another page visit again.

This is annoying - if user shows a desire to hide this popup, the popup should remain closed on every new page load.

To reproduce

  1. Go to https://ethereum.org/cs/learn/
  2. Click on '.x.' to close translator popup
  3. Go to web3 page
  4. See error - popup appears again.

Expected behavior

Pop up remains closed if user closed it.

Screenshots

No response

Desktop (please complete the following information)

No response

Smartphone (please complete the following information)

No response

Additional context

Screenshot 2023-09-28 at 18 47 06

Would you like to work on this issue?

  • Yes
  • No
@konopkja konopkja added the bug 🐛 Something isn't working label Sep 28, 2023
@github-actions github-actions bot added the needs triage 📥 This issue needs triaged before being worked on label Sep 28, 2023
@konopkja
Copy link
Contributor Author

konopkja commented Oct 2, 2023

design sync discussion: add button "dont show this again" which hides the banner for "x" time e.g. 2 weeks

@konopkja konopkja added dev required This requires developer resources medium priority This has a medium priority labels Oct 2, 2023
@rohan9024
Copy link
Contributor

@konopkja I would like to work on this. Please assign me.

@wackerow
Copy link
Member

wackerow commented Oct 3, 2023

Thanks @rohan9024!

Some things to keep in mind here... Non-English paths (ie: /es/anything) can either:

  • (a) have no translated content available for a given page,
  • (b) have translated content that isn't fully up to date with English, or
  • (c) be fully up-to-date with English copy.

For (a), we display the English page instead, with a notice asking if they'd like to contribute to translations
For (b), we display the available translations, with a notice asking if they'd like to contribute to translations AND also an option to view the full English page
For (c), we don't/shouldn't display anything

Sounds like we want the option to dismiss the solicitation for contributing specifically. Just keep in mind that we'll still want to show the banner for users who land on a page with more up-to-date content available on the English version (option b above)... @konopkja if you have any thoughts from the design side on how to best handle this that could be helpful.

Also @rohan9024, note that we have a useLocalStorage hook that can be used to help store this preference

@rohan9024
Copy link
Contributor

Thank you @wackerow

I'll proceed with implementing option b

@rohan9024
Copy link
Contributor

A quick question @wackerow

Can you please help me navigating the translation pages in the codebase? So that I can just figure out why this bug is occurring

@konopkja
Copy link
Contributor Author

ping @corwintines @wackerow

Copy link
Contributor

github-actions bot commented Dec 2, 2023

This issue is stale because it has been open 45 days with no activity.

@github-actions github-actions bot added the Status: Stale This issue is stale because it has been open 30 days with no activity. label Dec 2, 2023
@wackerow wackerow removed Status: Stale This issue is stale because it has been open 30 days with no activity. needs triage 📥 This issue needs triaged before being worked on labels May 2, 2024
@wackerow
Copy link
Member

wackerow commented May 2, 2024

Hey @rohan9024, apologies that we let this run stale.. Q4 was busy for our team and still catching up.

First, curious if you're still interested in tackling this?

If so,

For (a), we display the English page instead, with a notice asking if they'd like to contribute to translations
For (b), we display the available translations, with a notice asking if they'd like to contribute to translations AND also an option to view the full English page
For (c), we don't/shouldn't display anything

I'll proceed with implementing option b

Sorry for the confusion, but a, b and c above were not choices, but they are the three possible scenarios we encounter for a given page. We need to account for all three.

For (a), we display the English page instead, with a notice asking if they'd like to contribute to translations

design sync discussion: add button "dont show this again" which hides the banner for "x" time e.g. 2 weeks

In this scenario, we need to add a second button to not show again.

  • This button should set an expiration date in localstorage (saved in the browser) for 2 weeks (ie. translationBannerHideUntil=2024-05-16T21:45:00Z).
  • We then also need to add logic to check if this key exists in localstorage, and if it's a date in the future, prevent showing this popup to begin with.

For (b), we display the available translations, with a notice asking if they'd like to contribute to translations AND also an option to view the full English page

@konopkja Curious how you want to handle this case. In this case, the content is more up-to-date in English, but some translate content does exist. We have two buttons here already—one to go to the more-updated English content, and one soliciting help translating.

Can you please help me navigating the translation pages in the codebase? So that I can just figure out why this bug is occurring

For reference, the logic for when this banner shows up or not can be traced from the RootLayout.tsx component:

// src/layouts/RootLayout.tsx

export const RootLayout = ({
  children,
  contentIsOutdated,
  contentNotTranslated,
  lastDeployDate,
}: Root) => {

//...

  const isPageLanguageEnglish = locale === DEFAULT_LOCALE

  const shouldShowTranslationBanner =
    (contentIsOutdated || (contentNotTranslated && !isPageLanguageEnglish)) &&
    !isLegal

// ...
      <TranslationBanner
        shouldShow={shouldShowTranslationBanner}
        isPageContentEnglish={contentNotTranslated}
        originalPagePath={originalPagePath}
      />

The component itself would be src/Components/TranslationBanner.tsx. This is where I would focus by adding a button and the above logic to work with localStorage.

@konopkja
Copy link
Contributor Author

konopkja commented May 3, 2024

Hey @rohan9024, apologies that we let this run stale.. Q4 was busy for our team and still catching up.

First, curious if you're still interested in tackling this?

If so,

For (a), we display the English page instead, with a notice asking if they'd like to contribute to translations
For (b), we display the available translations, with a notice asking if they'd like to contribute to translations AND also an option to view the full English page
For (c), we don't/shouldn't display anything

I'll proceed with implementing option b

Sorry for the confusion, but a, b and c above were not choices, but they are the three possible scenarios we encounter for a given page. We need to account for all three.

For (a), we display the English page instead, with a notice asking if they'd like to contribute to translations

design sync discussion: add button "dont show this again" which hides the banner for "x" time e.g. 2 weeks

In this scenario, we need to add a second button to not show again.

  • This button should set an expiration date in localstorage (saved in the browser) for 2 weeks (ie. translationBannerHideUntil=2024-05-16T21:45:00Z).
  • We then also need to add logic to check if this key exists in localstorage, and if it's a date in the future, prevent showing this popup to begin with.

For (b), we display the available translations, with a notice asking if they'd like to contribute to translations AND also an option to view the full English page

@konopkja Curious how you want to handle this case. In this case, the content is more up-to-date in English, but some translate content does exist. We have two buttons here already—one to go to the more-updated English content, and one soliciting help translating.

Can you please help me navigating the translation pages in the codebase? So that I can just figure out why this bug is occurring

For reference, the logic for when this banner shows up or not can be traced from the RootLayout.tsx component:

// src/layouts/RootLayout.tsx

export const RootLayout = ({
  children,
  contentIsOutdated,
  contentNotTranslated,
  lastDeployDate,
}: Root) => {

//...

  const isPageLanguageEnglish = locale === DEFAULT_LOCALE

  const shouldShowTranslationBanner =
    (contentIsOutdated || (contentNotTranslated && !isPageLanguageEnglish)) &&
    !isLegal

// ...
      <TranslationBanner
        shouldShow={shouldShowTranslationBanner}
        isPageContentEnglish={contentNotTranslated}
        originalPagePath={originalPagePath}
      />

The component itself would be src/Components/TranslationBanner.tsx. This is where I would focus by adding a button and the above logic to work with localStorage.

i dont remember why we decided this way, but i think any action to close the popup should be remembered for XYZ amount of time.

With that in mind in the scenario where there is translated but outdated content we should prioritize 2 most important actions:

  1. Go to English
  2. dont show again

In regular scenario

  1. Go to the translation program
  2. dont show again

@wackerow wackerow added the help wanted Extra attention is needed or someone is needed to help label May 13, 2024
@wackerow wackerow self-assigned this May 15, 2024
@corwintines
Copy link
Member

Since #13005 was merged in, this UX issue doesnt exist anymore since these banners no longer appear. Going to close this out with that merged.

Note: the core team is looking at adding the logic back in for showing these translation banners as part of the performance epic being worked on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working dev required This requires developer resources help wanted Extra attention is needed or someone is needed to help medium priority This has a medium priority
Projects
None yet
Development

No branches or pull requests

4 participants