Page MenuHomePhabricator

Give feedback for transcription preview
Closed, ResolvedPublic8 Estimated Story Points

Description

There should be some feedback from the request to synthesize transcription preview on the EditLexicon special page.

When successful it takes a second or two to receive the response. The user should be able to tell when it is done and ready to listen to.

If there is an error from Speechoid, this should be displayed somehow, e.g. in a message dialogue. The simplest way would be a generic "something went wrong message", but these are seldom useful. It should at least include the Speechoid error, which looks like this:

ERROR: failed mapping transcription : found unknown phonemes in transcription /a:.pa/: [:]

You can test the error by supplying invalid transcription in the lexicon editor and clicking "Preview". E.g. in English you can enter just enter e (normal letter "e").

Event Timeline

Included in this is probably to disable the "send" button to indicate that it is being processed, to prevent people from pressing it again if it is slow.

Per the OOUI demo setting disabled: true on the button until the sound is recieved would probably be a good first step.

I ran into this when testing the new producer server. First off the exception in the API should be caught and cause an API error. It does cause an API error now, but also logs an error, which I don't think we want. Also for some reason the API error doesn't include the message from Speechoid on the new server, even if it does locally.

This got me thinking about what we actually want the error to say. Currently it's:

Could not generate preview
The error from the server was: [d198520368f624f608c55741] Exception caught: Unexpected response from Speechoid: ERROR: failed mapping transcription : found unknown phonemes in transcription /ˈmiːdi.əˌwɪki/: [ː]

What is actually helpful information for the user seeing this, in this case someone editing the lexicon via the special page?

The error from the server was:

"The server" isn't explained and probably not known by the user. If anything, they'd probably guess the MW backend, but it's actually Speechoid. Changing to "Speechoid" would just swap it to another unknown thing unless they've read up on Wikispeech architecture. This part should probably be removed.

[d198520368f624f608c55741] Exception caught:

This is just technical terms and should be removed by using an actual API error.

Unexpected response from Speechoid:

Again, this is probably not something that helps the end user. "Response" is just a technical term for communication between different parts of Wikispeech. And again "Speechoid" may not be known. Even if it is, it probably doesn't help them understand what's going on.

ERROR: failed mapping transcription : found unknown phonemes in transcription /ˈmiːdi.əˌwɪki/: [ː]

Here's where we actually get some important information, i.e. what went wrong. That said, "ERROR" doesn't add anything, they should understand that something went wrong because of the popup title. "failed mapping transcription" probably not really useful. This part of the message is from Speechoid so we can't easily change it (technically we can assume that the error string will look a certain way and edit it, but I don't think that's a good idea. The rest of this part is the information the user needs, i.e. what went wrong.

I think that keeping only the last bit and adding some direction for how to solve it is what we want. The latter should link to Help:Extension:Wikispeech/Lexicon_editor#Symbol_sets where they can see what's allowed.

The resulting message would then be something like:

ERROR: failed mapping transcription : found unknown phonemes in transcription /ˈmiːdi.əˌwɪki/: [ː]. You should change or remove these phonemes. A list of valid phonemes can be found at <LINK>.

Since this is the API error it should also make sense when the user uses the API, which I think it does in this case. Maybe the link needs to be formatted so that it works both as test in a response and in a popup.

@Lokal_Profil, @kalle: what do you think about this? I feel like this is something worth trying to get right from the start since unhelpful error messages can be very annoying for the user (speaking from experience).

Change 910430 had a related patch set uploaded (by Sebastian Berlin (WMSE); author: Sebastian Berlin (WMSE)):

[mediawiki/extensions/Wikispeech@master] API: Catch exception during transcription mapping and use `dieWithException()`

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

Change 917845 had a related patch set uploaded (by Sebastian Berlin (WMSE); author: Sebastian Berlin (WMSE)):

[mediawiki/extensions/Wikispeech@master] Editor: simplify mapping transcription error message

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

Change 917845 merged by jenkins-bot:

[mediawiki/extensions/Wikispeech@master] Editor: simplify mapping transcription error message

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

Change 910430 merged by jenkins-bot:

[mediawiki/extensions/Wikispeech@master] API: Catch exception during transcription mapping and use `dieWithException()`

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

Sorry for not responding to the earlier message.

Definitely liked the clean up of the error message and that it is now properly caught.

The "ERROR" - prefix I don't think is a problem to keep.

Adding an actionable instruction to the end would also make sens and make it a lot more useful. We would probably have to include another config variable for the link target and possibly some logic to handle if that is missing. There might be some bikeshedding to be done around exactly how what " You should change or remove these phonemes. " should say.

Included in this is probably to disable the "send" button to indicate that it is being processed, to prevent people from pressing it again if it is slow.

I got this working. I wonder if it's obvious to the user that they should wait. I think that it's more common to have some sort spinner or other visual effect to communicate this. I don't think anything like that in OOUI, though if we want to we could throw on some CSS animation. Alternatively we could change the label and/or add an icon. The problem with that is that it will change the size of the button, which is ugly. I don't think this is necessary since the wait is quite short, only a couple of seconds, but it might be worth keeping in mind if we get user feedback about it.

A related thing I noticed is that the button doesn't do anything before the module is loaded, so it's possible to click it and nothing happen if you're quick. It's unrelated and hopefully not that common, but I created T337494 to keep track of it anyway.

Change 924876 had a related patch set uploaded (by Sebastian Berlin (WMSE); author: Sebastian Berlin (WMSE)):

[mediawiki/extensions/Wikispeech@master] Editor: disable preview button when waiting for preview.

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

Change 964902 had a related patch set uploaded (by Sebastian Berlin (WMSE); author: Sebastian Berlin (WMSE)):

[mediawiki/extensions/Wikispeech@REL1_39] Editor: simplify mapping transcription error message

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

Change 964903 had a related patch set uploaded (by Sebastian Berlin (WMSE); author: Sebastian Berlin (WMSE)):

[mediawiki/extensions/Wikispeech@REL1_39] API: Catch exception during transcription mapping and use `dieWithException()`

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

Change 964902 merged by jenkins-bot:

[mediawiki/extensions/Wikispeech@REL1_39] Editor: simplify mapping transcription error message

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

Change 964903 merged by jenkins-bot:

[mediawiki/extensions/Wikispeech@REL1_39] API: Catch exception during transcription mapping and use `dieWithException()`

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

Change 924876 merged by jenkins-bot:

[mediawiki/extensions/Wikispeech@master] Editor: disable preview button when waiting for preview

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

Change 967772 had a related patch set uploaded (by Sebastian Berlin (WMSE); author: Sebastian Berlin (WMSE)):

[mediawiki/extensions/Wikispeech@REL1_39] Editor: disable preview button when waiting for preview

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

Change 967772 merged by jenkins-bot:

[mediawiki/extensions/Wikispeech@REL1_39] Editor: disable preview button when waiting for preview

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