Page MenuHomePhabricator

Add copy to clipboard function for text of user's revision (JS)
Closed, ResolvedPublic8 Estimated Story Points

Description

User Stories
As an experienced user accustomed to the old workflow
I want to be able to copy the entire text of my version
So that I can paste it into a separate document for safekeeping

As a user who edits or writes source code
I want to be able to copy the entire text of my version
So that I can paste it into a separate document,
So that I can manually merge it with the published version

Acceptance Criteria

  • The user can copy their entire revision in wikitext, not including any edits made in the 2Col interface, with a single click
  • On hover, users can read a browser tooltip explaining what will be copied
  • On click, the users receive a temporary confirmation message which vanishes after 5 sec

Mocks


On hover:

On click:

Wording/Specs
Add "(copy full text)" text after the "Your revision" title - also in bold. Use link styles for copy. On hover use standard browser tooltip saying, "Copy full wikitext of your revision to clipboard (edits made below are not included)".

On click, show temporary confirmation message: "The full wikitext of your revision has been copied to clipboard (edits made below are not included)." Match styles and animations from watchlist confirmation: position should be sticky if user scrolls, and then disappear.

Event Timeline

ECohen_WMDE renamed this task from *DRAFT* Add copy to clipboard function for users full revision in wikitext (JS and no-JS) to *DRAFT* Add copy to clipboard function for text of user's revision (JS and no-JS).May 27 2020, 3:53 PM
ECohen_WMDE renamed this task from *DRAFT* Add copy to clipboard function for text of user's revision (JS and no-JS) to Add copy to clipboard function for text of user's revision (JS and no-JS).May 28 2020, 7:31 AM
ECohen_WMDE updated the task description. (Show Details)
Lena_WMDE renamed this task from Add copy to clipboard function for text of user's revision (JS and no-JS) to Add copy to clipboard function for text of user's revision (JS).May 28 2020, 8:36 AM
Lena_WMDE updated the task description. (Show Details)

Peanut gallery comment: Novel design, but I really like it!

awight moved this task from Sprint Backlog to Doing on the WMDE-QWERTY-Sprint-2020-05-27 board.

Stealing fun task for self.

2 cents: Instead of "(copy)", what about "(Copy wikitext)"? I think this slight tweak clears up some possible confusion about the meaning of "copy".

Change 599321 had a related patch set uploaded (by Awight; owner: Awight):
[mediawiki/extensions/TwoColConflict@master] Give version label a concrete class

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

I discovered that a CopyTextLayout widget already exists in OOJS-UI. It's missing from the demo pages, which explains why we overlooked it initially. Here's a screenshot of how it looks:

Should we consider reusing? I at least wanted us to be aware of the existing precedent.

Unfortunately, this is still JS-only.

After looking at other implementations, I think we also need to show a notice when copying *fails*. I'd suggest something like,

Error when copying the full wikitext of your revision to clipboard.

Hey thanks for finding that OOUI copy bit- didn't come across it. Especially weird since that icon is not listed in the OOUI icons. Will take a look.

As far as the text goes, we can look at that. Maybe just one more word can make it more descriptive, but still be short. Good point on the error message as well.

Should have posted something here too, but Lena posted in mattermost - lets pause on this until we figure out the no-JS solution since it might impact this one. Since the goal is to keep them as consistent as possible, this might happen depending on the solution.

Also - glad you like the design! Was very disappointed to find out that this is not possible without JS, thought I had come up with a nice simple solution

Change 599321 merged by jenkins-bot:
[mediawiki/extensions/TwoColConflict@master] Give version label a concrete class

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

Updated description and mocks to change link/button text from "(copy)" to "(copy full text)"

awight removed awight as the assignee of this task.Jun 3 2020, 8:24 AM
awight moved this task from Doing to Sprint Backlog on the WMDE-QWERTY-Sprint-2020-05-27 board.

Change 599340 had a related patch set uploaded (by Awight; owner: Awight):
[mediawiki/extensions/TwoColConflict@master] [WIP] Link to copy your wikitext

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

Just to be explicit, I see that we all have the same assumption, that the copy feature only makes sense for the non-talk interface. I think this is correct, because the talk case guarantees that the only text changed by this user is in the one editable textarea.

@awight Thanks for clarifying - that's a good point. I was also assuming it was only for the 2Col interface, not the talk page use case. @Lena_WMDE can confirm?

Yes that's right @awight this should be applied only in the two-column interface.

Change 599340 merged by jenkins-bot:
[mediawiki/extensions/TwoColConflict@master] Link to copy your wikitext

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

Hi @awight I just noticed that the on hover browser tooltip says "your version" instead of your "revision" (as instructed in the ticket), which is inconsistent. Could you please update the text to say "Copy full wikitext of your revision to clipboard (edits made below are not included."? I have update the ticket as well. Thanks!

Change 603956 had a related patch set uploaded (by WMDE-Fisch; owner: WMDE-Fisch):
[mediawiki/extensions/TwoColConflict@master] Use "revision" in copy link title text

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

Change 603956 merged by jenkins-bot:
[mediawiki/extensions/TwoColConflict@master] Use "revision" in copy link title text

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

WMDE-Fisch moved this task from Review to Demo on the WMDE-QWERTY-Sprint-2020-05-27 board.
WMDE-Fisch moved this task from Demo to Done on the WMDE-QWERTY-Sprint-2020-05-27 board.

Reviewed at the end of the sprint review meeting. Title is there and deployed on the beta cluster.

Change 607237 had a related patch set uploaded (by Thiemo Kreuz (WMDE); owner: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/TwoColConflict@master] Fix broken copy link in JS mode

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

Change 607237 merged by jenkins-bot:
[mediawiki/extensions/TwoColConflict@master] Fix broken copy link in JS mode

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

Change 607248 had a related patch set uploaded (by Awight; owner: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/TwoColConflict@wmf/1.35.0-wmf.37] Fix broken copy link in JS mode

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

Change 607248 merged by jenkins-bot:
[mediawiki/extensions/TwoColConflict@wmf/1.35.0-wmf.37] Fix broken copy link in JS mode

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

Mentioned in SAL (#wikimedia-operations) [2020-06-23T11:34:51Z] <awight@deploy1001> Synchronized php-1.35.0-wmf.37/extensions/TwoColConflict/: BACON: [[gerrit:607248|Fix broken copy link in JS mode (T253724)]] (duration: 00m 57s)