Page MenuHomePhabricator

Right-click-to-copy doesn't work on templated table cells (because of the shield?)
Closed, ResolvedPublic8 Estimated Story Points

Description

Dear all,

Please take a look at the following GIF animation:

As you can see, I am not able to copy and paste a template in the visual table editor. Instead of creating a proper copy of the template, it only produces an enlarged empty cell.

Can anyone confirm this problem?

Thankfully,

-Robert

Event Timeline

Restricted Application added a project: VisualEditor. · View Herald TranscriptAug 28 2016, 11:41 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Jdforrester-WMF renamed this task from Cannot copy-paste a template in the visual table editor to Right-click-to-copy doesn't work on templated table cells (because of the shield?).Sep 13 2016, 7:34 PM
Jdforrester-WMF triaged this task as Medium priority.
Jdforrester-WMF set the point value for this task to 8.
Jdforrester-WMF moved this task from To Triage to TR0: Interrupt on the VisualEditor board.
DLynch added a subscriber: DLynch.Sep 19 2016, 3:37 PM

Not just right-click. Selecting the templated-cell and using the keyboard to copy-paste produces the same result.

Not just right-click. Selecting the templated-cell and using the keyboard to copy-paste produces the same result.

It works for me?

Trying with the table at https://en.wikipedia.org/wiki/BIOS#Vendors_and_products, Ctrl+C – Ctrl+V works for me, but only when copy-pasting a templated cell over a templated cell. (There's no "Copy" option in the context menu when right-clicking at all.) Trying to paste a templated cell over a normal cell clears its contents, and trying to paste a normal cell over a templated cell completely wrecks the table. (Chromium 54 on Windows 10)

The same for me on Ubuntu 16.10 with Chrome.

Does it work for you on this table?

https://en.wikipedia.org/wiki/User:Orschiro/sandbox

DLynch added a comment.May 1 2017, 4:49 PM

So, the paste data is:

<meta charset='utf-8'><table class="wikitable sortable" id="mwBg">
<tbody id="mwBw"><tr id="mwGw">
<td style="background:#9F9;vertical-align:middle;text-align:center;" class="table-yes" typeof="mw:Transclusion" about="#mwt2" data-mw="{&quot;parts&quot;:[&quot;|&quot;,{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;Yes&quot;,&quot;href&quot;:&quot;./Template:Yes&quot;},&quot;params&quot;:{},&quot;i&quot;:0}}]}" id="mwFw" data-ve-no-generated-contents="true" data-ve-attributes="{&quot;style&quot;:&quot;background:#9F9;vertical-align:middle;text-align:center;&quot;,&quot;typeof&quot;:&quot;mw:Transclusion&quot;,&quot;about&quot;:&quot;#mwt2&quot;}">Yes</td></tr>
</tbody></table>

This, plus having a clipboard key, trips all the relevant flags for it to attempt TableAction.importTable. The contents of the existing cell are removed, the attributes from the transclusion-cell are copied onto it, and then the (empty) data of the transclusion cell is added.

...this doesn't work out very well, I think because just applying the attributes is insufficient to actually change the cell into a TransclusionNode.

Change 351885 had a related patch set uploaded (by DLynch; owner: DLynch):
[VisualEditor/VisualEditor@master] TableAction: Handle non-TableCell cells better

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

Change 351883 had a related patch set uploaded (by DLynch; owner: DLynch):
[mediawiki/extensions/VisualEditor@master] MWTransclusionNode: Implement MWTransclusionTableCell

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

Change 351885 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] TableAction: Handle non-TableCell cells better

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

Change 353838 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (8e29310db)

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

Change 353899 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (45aa796b3)

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

Change 353838 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (8e29310db)

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

Change 351883 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] MWTransclusionNode: Implement MWTransclusionTableCell

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

orschiro removed a subscriber: orschiro.May 16 2017, 4:43 AM
Jdforrester-WMF closed this task as Resolved.May 16 2017, 8:22 AM
Jdforrester-WMF removed a project: Patch-For-Review.
Restricted Application added a project: User-Ryasmeen. · View Herald TranscriptMay 16 2017, 8:22 AM