Open Bug 1893701 Opened 2 years ago Updated 8 months ago

Consider adjusting behavior for "Offer to Translate"

Categories

(Firefox :: Translations, enhancement)

enhancement

Tracking

()

People

(Reporter: olivia, Unassigned)

References

Details

Attachments

(1 file)

When changing the "offer to translate" setting, the offer or pop-up will not occur in that session, since the opportunity to offer has already passed on that host. This is to consider adjusting the behavior to reset the "offer" conditions when they change. Bug 1885340 has more specific instructions on how to cause this behavior.

This is a joint Android and Desktop bug identified in QA as bug 1885340, but resolved as WORKSFORME since Android and Desktop had parallel behavior, because it is probably originating from the toolkit logic.

Hey Olivia!

Thanks for reporting this. It's an easy change to make, and I think the behavior makes sense.

It would just have to call resetHostsOffered() when that setting is toggled back on.

I've pushed up a WIP patch with the changes (for Desktop), but no test yet.

I will add a test and finish the patch if everyone agrees this is desirable behavior.

Flags: needinfo?(gtatum)

Resets the set of offered hosts when the user explicitly
re-enables the "Always offer to translate" setting, because,
presumably, they would like to see the panel offered again.

Flags: needinfo?(dandriyenko)

Thanks for taking a look!

Actually I think the bug is that we add the hosts too soon in the maybeOfferTranslations function.

https://searchfox.org/mozilla-central/rev/279e588a6d5fcb2f652fc26345ddb2a3b4d58b0e/toolkit/components/translations/actors/TranslationsParent.sys.mjs#518

Basically:
TranslationsParent.#hostsOffered.add(host);

Should be right before:

      browser.dispatchEvent(
        new CustomEvent("TranslationsParent:OfferTranslation", {
          bubbles: true,
        })
      );
Flags: needinfo?(gtatum)

Thank you so much Eric for tagging me in this. Olivia and I chatted about this being a nice behavior to tweak for Mobile and Desktop. Let me know if y'all need any other UX POV.

See Also: → 1896093

I followed the STR listed here with the fix described in comment 4 but I don't think it fixes the behavior.

At least on Desktop, I think we would still have to reset the hosts when always-offer is toggled on.

Flags: needinfo?(dandriyenko)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: