Page MenuHomePhabricator

Improve messaging when switching with multiple disallowed syntax types
Open, Needs TriagePublic

Description

Separated out form T259673:

Behavior

When someone does the following:

  1. Writes a comment in the tool's source mode that contains any combination of a table, template or extension
  2. Attempts to switch to the tool's visual mode

Desired

  1. ✅They should see a dialog that says:
Dialog titleDialog body
Visual mode disabledSorry, switching to visual mode is disabled because the syntax below was detected in the comment you have written. [Learn more](mw:Extension:DiscussionTools/Reply_tool_visual_mode_limitations). <ul> <li>Extension</li> <li>Table</li> <li>Template</li> </ul>

Note: only the syntax that you have written in "Step 1" should in the list that appears within the Visual mode disabled dialog.

Existing

  1. ❗️They see a dialog that says:
Dialog titleDialog body
Visual mode disabledSorry, switching to visual mode is disabled because <b>$1</b> was detected in the comment you have written. [https:\/\/www.mediawiki.org\/wiki\/Special:MyLanguage\/Extension:DiscussionTools/Reply_tool_visual_mode_limitations Learn more].

Notes

  • When implementing the Desired behavior described in the ===Behavior section above, we should do as @DLynch described in T263261#6474621 and implement it as a new message rather than as an edit to an existing one.

Done

  • "Desired" behavior is implemented

Event Timeline

I guess it'd be easier if we made a new translation message for it, so we don't have an overlapping period where the old messages in non-english are looking particularly broken for expecting a parameter.

I like the way Wikidata constraint violation warnings work: they use a full sentence without any list syntax if they want to say one or two things (like one or two classes wbqc-violation-message-valueType-instance), and displays a list from three things on. We may limit the listless version to only one type, though. What is really important for me is that the long version (i.e. the one that uses a list) ends its sentence with a colon; without that, the list doesn’t really belong to the sentence before it. My proposal for the message is therefore

Sorry, switching to visual mode is disabled because {{PLURAL:$2|1=<strong>$1</strong>|the following syntax}} was detected in the comment you have written ([https://www.mediawiki.org/wiki/Special:MyLanguage/Extension:DiscussionTools/Reply_tool_visual_mode_limitations Learn more]){{PLURAL:$2|1=.|: $3}}

where $1 is the detected syntax if there’s only one and may be anything if there are multiple forbidden syntax types, $2 is the number of forbidden syntax types, and $3 is the list of forbidden syntax types if there’s more than one. (I think maybe the easiest to unconditionally put the first forbidden syntax type in $1, and unconditionally put a (probably one-item) list in $3, but translators shouldn’t rely on this.)

I guess it'd be easier if we made a new translation message for it, so we don't have an overlapping period where the old messages in non-english are looking particularly broken for expecting a parameter.

Creating a new message means that existing translations are lost. While ugly-looking messages aren’t nice, losing translations is neither. @Nikerabbit, is there a way to fuzzy this message in a way that translations disappear from exports until they’re updated (but remain in Translatewiki)?

Creating a new message means that existing translations are lost. While ugly-looking messages aren’t nice, losing translations is neither. @Nikerabbit, is there a way to fuzzy this message in a way that translations disappear from exports until they’re updated (but remain in Translatewiki)?

No.

Creating a new message means that existing translations are lost. While ugly-looking messages aren’t nice, losing translations is neither. @Nikerabbit, is there a way to fuzzy this message in a way that translations disappear from exports until they’re updated (but remain in Translatewiki)?

No.

That’s unfortunate. Given the constraints, what do you think to be the best solution to handle this change?

Creating a new message means that existing translations are lost. While ugly-looking messages aren’t nice, losing translations is neither. @Nikerabbit, is there a way to fuzzy this message in a way that translations disappear from exports until they’re updated (but remain in Translatewiki)?

No.

That’s unfortunate. Given the constraints, what do you think to be the best solution to handle this change?

@Tacsipacsi: we're glad you identified this tradeoff (see the bolded bit in the quoted text above).

Absent of @Nikerabbit being aware of a way for us to update the message without creating the scenario @DLynch described in T263261#6474621, I'd rather us replace the message entirely even if it means there could be some period of time where these messages appear in English.

I've represented this thinking in the task description's newly created ===Notes section.