Closed Bug 1903838 Opened 3 months ago Closed 3 months ago

SelectTranslationsPanel does not report the to-language-changed event to telemetry if both languages are changed prior to retranslation

Categories

(Firefox :: Translations, defect, P3)

defect

Tracking

()

VERIFIED FIXED
129 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox127 --- unaffected
firefox128 --- verified
firefox129 --- verified

People

(Reporter: nordzilla, Assigned: nordzilla)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files)

Description

There is an edge case in the Select Translations Panel in which, using keyboard navigation, the user can change both the from-language and the to-language before triggering re-translation.

When this happens, currently, only the from-language change is reported to telemetry. We should fix this so that both language-change events are reported to telemetry.


Steps to reproduce

Note: This is only reproducible using keyboard navigation on Windows and Linux, because those two operating systems allow you to change the from-language and to-language directly with the keyboard without opening the dropdown menu list. When the language is changed directly, the panel waits for the Enter key to be pressed, or for the <textarea> element to receive focus before translating. However on macOS, the keyboard navigation events always opens the menu-list dropdown, in which case selecting a new language will trigger a translation when the dropdown closes.

  • Ensure that the toolkit.telemetry.translations.logLevel pref is set to Debug.
  • Open the Browser Console and filter the output on onChange.
  • Navigate to a translatable web page, e.g. https://es.wikipedia.org
  • Select some text, right click, and open the Select Translations Panel by clicking the "Translate selection...." item.
  • Press Tab until the focus is on the from-menu list.
  • Use the Up/Down arrow keys to change the language directly (without triggering a translation yet).
  • Press Tab once to shift the focus to the to-menu list.
  • Use the Up/Down arrow keys to change the language directly (without triggering a translation yet).
  • Trigger a translation by pressing Enter or continuing to use Tab to shift the focus to the textarea.

Expected Behavior

  • Both the onChangeFromLanguage and onChangeToLanguage events should be logged to the browser console.

Actual Behavior

  • Only the onChangeFromLanguage event is logged to the browser console.

Tests to implement

  • Implement more thorough tests that change the from-language and to-language menus in all possible ways, both independently and together, to ensure that only the relevant telemetry events are fired in all cases.
Summary: SelectTranslationsPanel under-reports to-language-changed to telemetry if both languages are changed prior to retranslation → SelectTranslationsPanel under reports the to-language-changed event to telemetry if both languages are changed prior to retranslation
Summary: SelectTranslationsPanel under reports the to-language-changed event to telemetry if both languages are changed prior to retranslation → SelectTranslationsPanel does not report the to-language-changed event to telemetry if both languages are changed prior to retranslation

Fixes an edge case in the SelectTranslationsPanel where,
on Windows and Linux, if both the from-language and to-language
are changed via keyboard before triggering re-translation, then
only the change-from-language event is logged to telemetry.

Attachment #9408687 - Attachment description: WIP: Bug 1903838 - Fix change-to-language telemetry edge case r=#translations-reviewers! → Bug 1903838 - Fix change-to-language telemetry edge case r=#translations-reviewers!

Set release status flags based on info from the regressing bug 1903391

Pushed by enordin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d33784dcf781 Fix change-to-language telemetry edge case r=translations-reviewers,gregtatum

Fixes an edge case in the SelectTranslationsPanel where,
on Windows and Linux, if both the from-language and to-language
are changed via keyboard before triggering re-translation, then
only the change-from-language event is logged to telemetry.

Original Revision: https://phabricator.services.mozilla.com/D214419

Attachment #9408702 - Flags: approval-mozilla-beta?

beta Uplift Approval Request

  • User impact if declined: The SelectTranslationsPanel onChangeToLanguage event will //not// be recorded in the edge-case event on Linux/Windows where the user changes both the from-language and to-language values via keyboard before triggering retranslation.
  • Code covered by automated testing: yes
  • Fix verified in Nightly: yes
  • Needs manual QE test: yes
  • Steps to reproduce for manual QE testing: STR in bug description.
  • Risk associated with taking this patch: Very low
  • Explanation of risk level: This is a one-line code change that only affects telemetry, and is quite thoroughly tested in automation.
  • String changes made/needed: None
  • Is Android affected?: no
Flags: qe-verify+
Flags: in-testsuite+
Attachment #9408702 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 129 Branch
QA Whiteboard: [qa-triaged]

Verified on Firefox 128.0b7 and on Firefox 129.0a1 using Windows 10, Ubuntu 22 and macOS 12, both the onChangeFromLanguage and onChangeToLanguage events were logged to the browser console.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: