Page MenuHomePhabricator

Instrument the special characters toolbar
Open, Needs TriagePublic

Description

This task is about adding the instrumentation necessary for us to know when people are using the visual editor's and wikieditor's [i] special characters toolbar [ii].

Background

T249072 asks for the Reply Tool to add support for the special characters toolbar.

In order to help decide how highly adding this support should be prioritized, we would like to know how often this feature is currently being used in other editing interfaces, where it is included.

Testing instructions

On https://en.wikipedia.beta.wmflabs.org/, verify the "Actions" (left column) cause the "Event(s)" (right column) to be emitted.

ActionEvent(s)
In VE, open the Special characters toolbar by clicking the Ω icon in VE's toolbarfeature: specialCharacter, action: window-open-from-tool
In VE, close the Special characters toolbar by pressing the Escape keyfeature: specialCharacter, action: dialog-abort
In VE, close the Special characters toolbar by clicking the Ω icon in VE's toolbarfeature: specialCharacter, action: dialog-abort
In VE, insert a character from the Special characters toolbar by clicking the Ω icon to open the toolbar and selecting a symbol from the "Greek" character setfeature: specialCharacter, action: insert-greekextended
In VE, insert a character from the Special characters toolbar by clicking the Ω icon to open the toolbar and selecting a symbol from the "Often used" character setfeature: specialCharacter, action: insert-other

Requirements

The instrumentation we implement as part of this task should enable us to know:

  1. When someone opens or closes the special characters toolbar
  2. When someone adds a character from the special characters toolbar to the document
    • 2A. Which "set" the "added character" belongs (read: every time a character is added, we should log which group/set it came from (e.g. Latin, Latin extended, IPA, etc.))

Open questions

  • What events are required?
  • What should these events be called?
  • In what schema should these events be logged?

Done

  • All "Open questions" are answered
  • The changes described in the "Requirements" section above are implemented.
  • @Ryasmeen: verify the events described in the "Requirements" section above are "firing" as described
  • @MNeisler: update any relevant instrumentation spec with the events added as part of this task.
  • @MNeisler: document whether the events implemented as part of this task are landing in the database in the ways we expect
  • @MNeisler: update documentation [iii] with events added as part of this task. Note: This will be done after everything looks good on production.

i. https://www.mediawiki.org/wiki/User:DLynch_(WMF)/VisualEditor/Configurations#Data_analysis_notes
ii.


iii. E.g. VisualEditorFeatureUse data dictionary

Event Timeline

wikieditor's [i] special characters toolbar [ii]

I think you mean the WikiEditor extension here. There’s another method provided by the CharInsert extension, usually invoked in MediaWiki:Edittools. This is JavaScript-based, but also works without JS by letting users simply copy&paste the characters. The JS-less experience cannot be logged, of course, but the button clicks can.

ppelberg updated the task description. (Show Details)Sep 30 2020, 5:14 PM
  • "Engage" = open/close
  • Every time a character is added, we log which group it came from
ppelberg updated the task description. (Show Details)Sep 30 2020, 7:45 PM

Change 631861 had a related patch set uploaded (by DLynch; owner: DLynch):
[VisualEditor/VisualEditor@master] Logging for special characters overlay

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

DLynch added a comment.Oct 2 2020, 8:14 PM

This patch will log:

  • feature: specialCharacter, method: window-toggle-from-tool
  • feature: specialCharacter, method: insert-Latin extended (or any of the other labels for the character-pages)

The former is a little different from our current dialog events. You'll get the toggle event for open and close, unlike the rest which do window-open-from-tool and then dialog-abort (or similar). This is currently done this way because at the point of logging we don't know whether it'll be opening or closing a window, and then when we know whether it's opening or closing we don't know what the source was. If you feel this matters things can be refactored, but...

The latter is providing whatever-is-on-the-page. If consistency is preferred, I could remove spaces/capitals and get us to e.g. insert-latinextended.

ppelberg reassigned this task from DLynch to MNeisler.Oct 7 2020, 7:45 PM

Update
@MNeisler and I just talked about this.

Next steps

  • @MNeisler to review the logging @DLynch proposed implementing in 631861 and described in T264146#6513851
  • Once Megan signs off on implementation, this can go back to Editing Team for code review
DLynch added a comment.Oct 7 2020, 7:50 PM

The current state in code-review is that we're adjusting it so that it'll be the standard window-[open/close]-from-tool method, incidentally.

Change 632827 had a related patch set uploaded (by DLynch; owner: DLynch):
[VisualEditor/VisualEditor@master] Logging for character insertion from the special characters panel

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

Change 631861 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] Refactor dialog logging out of ui.Command into ui.WindowAction

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

DLynch added a comment.Oct 8 2020, 2:07 PM

@ppelberg / @MNeisler - we've done the refactoring, so window-open-from-tool will be the event, consistent with all the others. We're waiting on your comments for a second patch that'll decide whether the actual insert should be logged as insert-Latin extended or insert-latinextended.

The latter is providing whatever-is-on-the-page. If consistency is preferred, I could remove spaces/capitals and get us to e.g. insert-latinextended.

We shouldn't use the translated label, or it be inconsistent across user languages. I see that the way we have written the dialog at the moment, it is not possible to access the symbolic name, so I'll do a bit of refactoring to make that possible.

Change 632936 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/VisualEditor@master] [PULL THROUGH] Fix output of fetchSpecialCharList to match new format

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

The above patch fixes the group name to be the symbolic name instead of the translated name, e.g. greekextended instead of Greek extended. This will now be the same regardless of the user interface language.

Change 632942 had a related patch set uploaded (by DLynch; owner: DLynch):
[mediawiki/extensions/VisualEditor@master] [PULL THROUGH] MWLinkAction: update call to window.open

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

@DLynch Thanks for the updates and ping.

Just to confirm I understand the changes noted above, the patch will now log:

feature: specialCharacter, method: window-open-from-tool (Will close events for this feature be logged as dialog-abort?)
feature: specialCharacter, method: insert-Latinextended (or any of the other labels for the character-pages)

The above proposed names sound good to me.

DLynch added a comment.Oct 8 2020, 5:21 PM

Will close events for this feature be logged as dialog-abort?

Actually... there's no current logging for the close, in any toolbar dialog (which is just special characters and find/replace), because they aren't a window and so bypass the standard logging. I'll go ahead and add that in for consistency, I guess.

Change 632967 had a related patch set uploaded (by DLynch; owner: DLynch):
[VisualEditor/VisualEditor@master] ToolbarDialog: log dialog-abort consistently with FragmentWindows

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

Change 632967 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] ToolbarDialog: log dialog-abort consistently with FragmentWindows

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

Change 632827 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] Logging for character insertion from the special characters panel

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

Change 632936 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (68c5f1a3c)

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

Change 632942 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] MWLinkAction: update call to window.open

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

Change 633023 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (dccfd0824)

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

Change 633023 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (dccfd0824)

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

ppelberg updated the task description. (Show Details)Oct 14 2020, 7:22 PM
ppelberg added a subscriber: Ryasmeen.

Note
Once code review is complete, please move this to #Editing-QA and assign it over to @Ryasmeen to verify.

MNeisler moved this task from Triage to Tracking on the Product-Analytics board.
DLynch reassigned this task from MNeisler to Ryasmeen.Oct 19 2020, 4:49 PM
DLynch moved this task from Code Review to QA on the Editing-team (FY2020-21 Kanban Board) board.
DLynch edited projects, added Editing QA; removed Patch-For-Review.
ppelberg moved this task from Inbox to High Priority on the Editing QA board.Thu, Oct 29, 9:21 PM
ppelberg updated the task description. (Show Details)Thu, Oct 29, 9:24 PM
ppelberg updated the task description. (Show Details)Thu, Oct 29, 9:53 PM

@DLynch are you able to review the task description's "Testing instructions" section for completeness [i] and accuracy?


i. I am assuming that if events are being emitted as expected for two character sets – Greek and Often used – we can assume all other character set events are working properly as well. If you think testing more than two character sets would be helpful, please update the "Testing instructions" section in the task description with the other sequences you think we ought to test.

You got some of the event names wrong, so I'm about to fix them.

In VE, insert a character from the Special characters toolbar by clicking the Ω icon to open the toolbar and selecting a symbol from the "Often used" character set

Just to note, you can only do this on wikis where the MediaWiki:Visualeditor-quick-access-characters.json message is configured so that it knows what the "often used" set is. If you're testing on e.g. mediawiki.org then that's not set up, and so this step won't be doable. (But in a completely expected way that shouldn't reflect a test-failure.)

DLynch updated the task description. (Show Details)Thu, Oct 29, 11:03 PM

...I'm about to fix them.

Thank you.

In VE, insert a character from the Special characters toolbar by clicking the Ω icon to open the toolbar and selecting a symbol from the "Often used" character set

Just to note, you can only do this on wikis where the MediaWiki:Visualeditor-quick-access-characters.json message is configured so that it knows what the "often used" set is. If you're testing on e.g. mediawiki.org then that's not set up, and so this step won't be doable. (But in a completely expected way that shouldn't reflect a test-failure.)

Understood.

Are you able to share a link where we can see what wikis have MediaWiki:Visualeditor-quick-access-characters.json configured so we know where to test this?

...my instinct was to check here [i], tho on a first look I didn't see MediaWiki:Visualeditor-quick-access-characters.json listed.

DLynch added a comment.Mon, Nov 2, 4:50 PM

Are you able to share a link where we can see what wikis have MediaWiki:Visualeditor-quick-access-characters.json configured so we know where to test this?

You just have to check the page of that name on the wiki and see if it exists.

e.g. on beta: https://en.wikipedia.beta.wmflabs.org/wiki/MediaWiki:Visualeditor-quick-access-characters.json

I don't think there's a convenient way to check for that across wikis without manually visiting and testing. (But I could be wrong.)

Are you able to share a link where we can see what wikis have MediaWiki:Visualeditor-quick-access-characters.json configured so we know where to test this?

You just have to check the page of that name on the wiki and see if it exists.

e.g. on beta: https://en.wikipedia.beta.wmflabs.org/wiki/MediaWiki:Visualeditor-quick-access-characters.json

I don't think there's a convenient way to check for that across wikis without manually visiting and testing. (But I could be wrong.)

Ah, I see. Okay. Thank you, David. I've updated the task description's "Test instructions" to specify this should be tested on Beta which should mean this is all ready for you to test, @Ryasmeen.

Ryasmeen added a comment.EditedMon, Nov 9, 7:44 PM

@ppelberg: Checked the feature and action value for all the events. For "Greek" character set, I think in the task description it's mistakenly written as action: insert-greekextended. It is getting correctly logged as action: insert-greek.

@ppelberg: Checked the feature and action value for all the events. For "Greek" character set, I think in the task description it's mistakenly written as action: insert-greekextended. It is getting correctly logged as action: insert-greek.

@DLynch can you confirm which of the following event names – Event Name A or Event Name B – we should expect to be emitted for the "Action" described in the table below?

ActionEvent Name AEvent Name B
In VE, insert a character from the Special characters toolbar by clicking the Ω icon to open the toolbar and selecting a symbol from the "Greek" character set feature: specialCharacter, action: insert-greekextendedfeature: specialCharacter; action: insert-greekextendedfeature: specialCharacter, action: insert-greek

B makes sense. It's asking for an insert from the "Greek" set, not "Greek extended", after all. (And inserting from "Greek extended" does indeed use insert-greekextended.) Sorry I didn't notice the mismatch when I was reviewing those.

ppelberg reassigned this task from Ryasmeen to MNeisler.Wed, Nov 18, 3:36 PM
ppelberg updated the task description. (Show Details)