Page MenuHomePhabricator

Visual mode lets you insert multi-line templates using the sequence `{{`
Closed, ResolvedPublic

Description

To reproduce:

  1. Go on a page of frwiki (Discussion Projet:Outils de discussion for example);
  2. Click on a Reply link;
  3. Switch to the Visual editor;
  4. Add the template Infobox Biographie2
  5. Add the parameter charte with the value acteur (parameter added for better observation, the same problem happens without parameter because it's a block template as defined in the TemplateData of the template);
  6. Switch to the Source editor. First problem, the template doesn't work in this editor (problem described in T253482);
  7. Switch back to the Visual editor. Second problem, the template doesn't work anymore unlike before;
  8. Switch again to the Source editor. Third problem, the Reply tool added nowiki tag.

Example.

Testing instructions

  • Verify that typing {{ does not trigger the template dialog.

Event Timeline

Thank you for filing this, @Lofhi. Two questions for you:

  1. What prompted you to try using the Infobox Biographie2 template with the Reply tool?
  2. What are particular scenarios when you would expect to be able to post the Infobox Biographie2 template within an indented comment?

I ask the above with the following in mind...

  • Until this point, we've intentionally not added supported for multi-line templates and tables to the Reply tool.
    • The assumptions that led to this decision are below.[1]
  • I wonder if there are use case(s) you have in mind that are a) common enough and b) the tool's current limitations around multi-line templates and tables not clear enough that something like T247421 ought to be prioritized.

1. Support for templates that contain line breaks

Version 1.0 of the new replying workflow (T235923) will not support templates that contain line breaks. In the longer term, per the point @Jc86035 raised in T241388#5761786, we plan to introduce new syntax for multiline list items (T230683) which should enable the software to support this functionality.

  • Thinking: we are assuming contributors will not expect the new replying workflow to support templates that contain line breaks considering the existing, full talk page editing, workflow does not support this functionality either. Furthermore, if contributors do attempt to use templates that contain line breaks, we are assuming the real-time preview (T238177) will communicate to them this functionality is not [yet] supported. If these assumptions end up not being true (read: contributors are attempting to use the new replying workflow to post templates that contain line breaks), we will consider addressing this behavior even before the new syntax is available which depends on a soon-to-be started RfC.

Change 602124 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/DiscussionTools@master] ReplyWidgetVisual: Disable template sequence

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

Esanders renamed this task from Reply tool is adding nowiki tag to multi-lines templates when switching editors to Visual mode lets you insert multi-line templates.Jun 3 2020, 6:29 PM
Esanders subscribed.

As Peter says, we unfortunately can't support multi-line templates until we have completed our RfC on new wikitext. As there's no reasonable way to know if a template will produce multiple lines in VE we have chose not to show the template tool. I assume you inserted the template by using the template sequence ({{) which the above patch disables.

Esanders renamed this task from Visual mode lets you insert multi-line templates to Visual mode lets you insert multi-line templates using the sequence `{{`.Jun 3 2020, 6:31 PM

What if and when someone enters a multiline template in source mode? (And what if they then switch to visual mode)

Source mode will show in the preview that the template won't render properly. You will see a similar failure when you switch to visual mode:

image.png (240×371 px, 13 KB)

becomes
image.png (187×238 px, 5 KB)

Thank you for filing this, @Lofhi. Two questions for you:

  1. What prompted you to try using the Infobox Biographie2 template with the Reply tool?
  2. What are particular scenarios when you would expect to be able to post the Infobox Biographie2 template within an indented comment?
  1. Not much, I was looking to break the tool. It's the first template on several lines that came to my mind, so I wanted to see the behavior of the editor. I can't tell how often multiline templates are used in discussions (rare at least), but they must exist (and if it's not on frwiki it would be elsewhere).
  2. Infobox templates are almost never used in discussions, it's extremely rare. It's at best to give an example (give the infobox a Wikidata element to fetch), but it happens every full moon... maybe rarer than that. I just think all the different types of models should work, because if they don't, it's going to be difficult for communities to adopt the tool.

[...] I assume you inserted the template by using the template sequence ({{) which the above patch disables.

Yes, that's it.

Source mode will show in the preview that the template won't render properly. You will see a similar failure when you switch to visual mode.

Thanks, I hope that no one will blame the tool for this behaviour until then.

Thank you for filing this, @Lofhi. Two questions for you:

  1. What prompted you to try using the Infobox Biographie2 template with the Reply tool?
  2. What are particular scenarios when you would expect to be able to post the Infobox Biographie2 template within an indented comment?
  1. Not much, I was looking to break the tool. It's the first template on several lines that came to my mind, so I wanted to see the behavior of the editor. I can't tell how often multiline templates are used in discussions (rare at least), but they must exist (and if it's not on frwiki it would be elsewhere).
  2. Infobox templates are almost never used in discussions, it's extremely rare. It's at best to give an example (give the infobox a Wikidata element to fetch), but it happens every full moon... maybe rarer than that.

Understood. This context is helpful.

I just think all the different types of models should work, because if they don't, it's going to be difficult for communities to adopt the tool.

We agree with you in thinking the tool needs to handle the majority of replies people, across experience levels, commonly post in order for it to a) become the default way people reply to comments on talk pages and b) for the tool to be adopted by a larger number of people.

With this said, we've assumed contributors will not expect the new replying workflow to support templates that contain line breaks considering the existing, full talk page editing, workflow does not support this functionality either.

Source mode will show in the preview that the template won't render properly. You will see a similar failure when you switch to visual mode.

Thanks, I hope that no one will blame the tool for this behaviour until then.

@Lofhi: if you come across instances of people being surprised/disappointed/etc. when the tool doesn't handle cases not supported by full page editing, we would value knowing. These cases would signal two things to us:

  1. We need to better understand what is contributing to people expecting the tool to handle multi-line templates within indented comments differently than how they are in full-page editing. With this information, we could then work on T247421 (assuming new syntax had not yet been introduced or is close to being introduced, per T246960, by these issues arise)
  2. It further validates the need for: T246960.

Change 602124 merged by jenkins-bot:
[mediawiki/extensions/DiscussionTools@master] ReplyWidgetVisual: Disable template sequence

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

That prevents inserting templates by typing {{. You can bypass this by copy-pasting a template from the normal visual editor, but I'm not sure if we want to try to prevent that.

That prevents inserting templates by typing {{. You can bypass this by copy-pasting a template from the normal visual editor, but I'm not sure if we want to try to prevent that.

Good spot, @matmarex. I've added the point you raised to T247421.

Reason: I think the point you raised belongs as part of the bigger conversation around //potentially/ drawing clearer distinctions between what people should expect to be able to do with/in the Reply tool and what people should expect to be able to do in/with other editing interfaces.