Page MenuHomePhabricator

"editor_open" event being logged when coming back from in-editor steps
Closed, ResolvedPublicBUG REPORT

Description

The "editor_open" event should be logged when the user first lands in the editor but not when the user goes back to the editor from steps that logically happen inside the editor. Those steps include "edit a sentence" and "Preview and publish".

Steps

  • From the dashboard, select a section suggestion
  • Choose a section to translate and click "Translate this section" to go to the editor
  • Observe that a "editor_open" event is being logged (this is good)
  • Click the "edit translation" button at the bottom of the screen
  • From the "Edit translation" screen, click the close (x) or confirm (>) button to go back to the editor

Actual

  • Observe that a "editor_open" event is logged

Expected

  • No "editor_open" event should be logged at this time

Derived Requirement

Ensure that the #editor_open event is logged only when the user first lands in the editor, and not when returning from in-editor steps such as "Edit translation" or "Preview and publish".

Test Steps

Test Case 1: Ensure #editor_open event is logged only on initial entry to the editor

  1. From the unified dashboard, select a section suggestion.
  2. Choose a section to translate and click the 'Translate this section' button.
  3. Observe the logged events using instrumentation or browser dev tools.
  4. ✅❓❌⬜ AC1: Confirm that the #editor_open event is logged when first landing in the editor.

Test Case 2: Ensure #editor_open event is not logged when returning from "Edit translation" step

  1. In the editor, click the "Edit translation" button at the bottom of the screen.
  2. From the "Edit translation" screen, click either the close (X) or confirm (>) button to return to the main editor.
  3. Observe the logged events.
  4. ✅❓❌⬜ AC2: Confirm that the #editor_open event is not logged upon returning from the in-editor "Edit translation" screen.

QA Results - Test Wiki

ACStatusDetails
1T391502#10784164
2T391502#10784164

Event Timeline

SBisson triaged this task as Medium priority.
SBisson updated Other Assignee, added: SBisson.
SBisson updated Other Assignee, removed: SBisson.

Change #1135475 had a related patch set uploaded (by Sbisson; author: Sbisson):

[mediawiki/extensions/ContentTranslation@master] Fix instrumentation by storing "previousRoute" in application state

https://gerrit.wikimedia.org/r/1135475

Change #1135475 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] Fix instrumentation by storing "previousRoute" in application state

https://gerrit.wikimedia.org/r/1135475

Change #1136452 had a related patch set uploaded (by Sbisson; author: Sbisson):

[mediawiki/extensions/ContentTranslation@master] CX3 Build 1.0.0+20250414

https://gerrit.wikimedia.org/r/1136452

Change #1136452 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX3 Build 1.0.0+20250414

https://gerrit.wikimedia.org/r/1136452

@SBisson can you pls direct me to where I can check for the "editor_open" event. would this be in the Network tab in Dev tools ?

@EChukwukere-WMF there are two ways to monitor instrumentation events in the browser:

  1. As you said, in the Network tab of the devtools. You can select the request type "Other" and filter with the string "events" to really narrow it down. Then you can inspect the payload of the request to check the event_type and other event information.

Screenshot 2025-04-29 at 8.38.35 AM.png (1×1 px, 269 KB)

  1. There is a preference that can be set to show all events in a small popup. This is the documentation: https://www.mediawiki.org/wiki/Extension:EventLogging/Programming#Client-side_logging

@SBisson I just want to confirm with you if this is what you are looking for based on the gifs below. Sorry for the wait time. AC1: 45sec gif and AC2: 39sec.

UPDATE: Great! I will move this to sign-off. Thanks for all your work!

Test Result - Test Beta

Status: ✅ PASS
Environment: Test Beta
OS: macOS Sequoia 15.4.1
Browser: Chrome 135
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Ensure #editor_open event is logged only on initial entry to the editor

  1. From the unified dashboard, select a section suggestion.
  2. Choose a section to translate and click the 'Translate this section' button.
  3. Observe the logged events using instrumentation or browser dev tools.
  4. AC1: Confirm that the #editor_open event is logged when first landing in the editor.

2025-05-01_11-13-25.mp4.gif (764×1 px, 3 MB)

Test Case 2: Ensure #editor_open event is not logged when returning from "Edit translation" step

  1. In the editor, click the "Edit translation" button at the bottom of the screen.
  2. From the "Edit translation" screen, click either the close (X) or confirm (>) button to return to the main editor.
  3. Observe the logged events.
  4. AC2: Confirm that the #editor_open event is not logged upon returning from the in-editor "Edit translation" screen.

2025-05-01_11-14-19.mp4.gif (764×1 px, 2 MB)

@SBisson I just want to confirm with you if this is what you are looking for based on the gifs below...

Yes, that's correct.

GMikesell-WMF updated Other Assignee, removed: GMikesell-WMF.
GMikesell-WMF moved this task from Needs QA to Design Signoff on the LPL Hypothesis board.