Page MenuHomePhabricator

Ensure plain text is pasted into DiscussionTools source mode
Closed, ResolvedPublic

Description

Behavior

Reply Tool
  1. Visit: https://patchdemo.wmflabs.org/wikis/12cdbb1f7baf0b71e7dc733aff3da949/w/index.php/Talk:Main_Page
  2. Copy a string of text that includes formatting. E.g. the string that reads @Ed hello Peter-peter (talk) 17:56, 15 February 2021 (UTC).
  3. Click a [ reply ] link to open the Reply Tool
  4. Navigate to the tool's source mode, if you are not there already
  5. Paste the text you copied in "Step 2" into the Reply Tool's source mode

Actual

  1. The Convert formatting to wikitext dialog appears

Desired

  1. ✅The plain text contents you copied in "Step 2" appear within the Reply Tool's text input.
New Discussion Tool
  1. Visit: https://patchdemo.wmflabs.org/wikis/12cdbb1f7baf0b71e7dc733aff3da949/w/index.php/Talk:Main_Page
  2. Copy a string of text that includes formatting. E.g. the string that reads @Ed hello Peter-peter (talk) 17:56, 15 February 2021 (UTC).
  3. Click the Add topic link to open the New Discussion Tool
  4. Navigate to the tool's source mode, if you are not there already
  5. Paste the text you copied in "Step 2" into the New Discussion Tool's source mode

Actual

  1. The Convert formatting to wikitext dialog appears

Desired

  1. ✅The plain text contents you copied in "Step 2" appear within the New Discussion Tool's text input.

Done

  • The "Desired" behavior listed in the ===Behavior section above is implemented

Event Timeline

Why? I don’t really like the new wikitext editor, but I think this feature is particularly nice and handy. What’s the reason for deliberately taking it away? The user still has the option to paste the unformatted text, but also has the option to paste it with all the formatting.

I agree with Tacsipacsi - the current behaviour seems desirable to me. The issues I reported at https://en.wikipedia.org/wiki/Wikipedia_talk:Talk_pages_project#Pasting_templates were not that this option appears but that when the "use plain text" option is selected nothing is pasted.

Why? I don’t really like the new wikitext editor, but I think this feature is particularly nice and handy. What’s the reason for deliberately taking it away? The user still has the option to paste the unformatted text, but also has the option to paste it with all the formatting.

The thinking that informed this decision is below. @Tacsipacsi + @Thryduulf, please let me know if anything below prompts new thoughts/questions.

Thinking

  1. People seem to all be aligned in their need for adding tools to DiscussionTools source mode. [i]
  2. It is not clear whether retaining text formatting upon pasting content, as it is currently implemented, [ii] is something most people will expect and value.
    • Consider:
      • People who use the Reply Tool's and New Discussion Tool's source mode expect for formatted text not to be preserved when pasted.
      • People who use the wikieditor expect for formatted text not to be preserved when pasted.
      • T218820
  3. Assuming people come to value the "enhanced" source mode with tools, we plan at some yet-to-be-defined future date, converge on single source mode [ii] (read: the source mode that is currently available in the Reply Tool and New Discussion Tool will be replaced).
    • Considering "2.", we do not want to entangle two features which are not equally supported.
    • Meta: when feasible, we want to keep changes isolated so we, and the people who are using them, can more easily evaluate the impact they are having on their experience.

The above has led us to think it is sensible to start by introducing the single toolbar change [iv] and if/when people come to desire the option of preserving text formatting when pasting content, we can introduce it then.[v]


i. T257391
ii. Current implementation: an "undismissable" popup that asks you whether you would like to paste plaintext or formatted. Note: @Esanders has already started experimenting with a more integrated "hint" that this functionality exists in T281010.
iii. See T276607
iv. Tools for formatting text, pinging, inserting links, etc.
v. See: T281009

The status quo is:

  • Someone copies formatted text and pastes it into the source mode of a reply or new discussion
  • A dialog asks whether they want to paste as plain text or convert it to Wikitext
  • The user chooses whichever option they want.

I still don't understand what the problem with this is? As long as both options do what they say they will do, then it doesn't matter what people want or expect (and I expect that any expectation for plain text is just that there has never been any option until now).

@Thryduulf can you share what you are defining as the "status quo" in T280745#7032329?

For context, I take the "status quo" in the context of this conversation to mean how the Reply and New Discussion Tools' source mode currently works. [i]


i. Formatted text pasted into the Reply or New Discussion Tools' source mode appears as plain text; people are not shown a prompt asking them if they would like to convert said copied text into formatted text.

I think jumping straight to T281010 would make sense here. It'd keep the ability to choose between plain and formatted, and get rid of the modal dialog. (And we have a patch for it already, so it's not a huge amount of extra work.)

@ppelberg the status quo at least on en.wp if (some?) formatted text is pasted the user is given a choice about whether to paste plain text or wikitext. imo the choice (whether by model dialog or some other method) is very significantly superior to always doing one or the other.

I think there's some dueling "what is the status quo?" here. Specifically, I think that @ppelberg is thinking about the status quo as the previous state of the reply tool (or maybe of WikiEditor?), and @Thryduulf is thinking of the status quo as being how the 2017 wikitext editor behaves elsewhere.

In terms of what people might reasonably expect, I find @Thryduulf has the more compelling position. The previous state of the reply tool's source mode was transitory and applied mostly to beta users for a few months, whereas a mainstream audience has been using the 2017 wikitext editor to reply to comments via full-page editing for years now...

whereas a mainstream audience has been using the 2017 wikitext editor to reply to comments via full-page editing for years now...

The 2017 wikitext editor is still a beta feature on all public wikis. The mainstream audience (i.e. who don’t bother with tweaking their preferences) still uses the 2010 editor (WikiEditor) on talk pages, which doesn’t allow pasting rich text.

Drat, you’re right, I’ve had that preference enabled for so long that I forget. I think my argument holds up about it being more widespread, but a status-quo comparison probably does apply best to WikiEditor. 😄

Change 684409 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/extensions/VisualEditor@master] Make convert to wikitext on paste feature configurable (temporarily)

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

Change 684410 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/extensions/DiscussionTools@master] Disable wikitext paste conversion in source mode

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

Change 684409 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Make convert to wikitext on paste feature configurable (temporarily)

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

@ppelberg the status quo at least on en.wp if (some?) formatted text is pasted the user is given a choice about whether to paste plain text or wikitext. imo the choice (whether by model dialog or some other method) is very significantly superior to always doing one or the other.

Understood – thank you sharing this context, @Thryduulf.

As @Tacsipacsi shared in T280745#7050620 and @DLynch commented in T280745#7050677, I too think of defining "status quo" in this context as how the 2010 wikitext editor and the Reply and New Discussion Tools' source modes behave.

As a result, we're going to move forward with "decoupling" the introduction of the new tools in DiscussionTools' source modes from the introduction of the "formatted paste" functionality (T281009).

Change 684410 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Disable wikitext paste conversion in source mode

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