Last modified: 2014-11-19 23:41:27 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T74315, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 72315 - VisualEditor: [Regression wmf5] Have to undo twice to reverse comment creation
VisualEditor: [Regression wmf5] Have to undo twice to reverse comment creation
Status: RESOLVED FIXED
Product: VisualEditor
Classification: Unclassified
Editing Tools (Other open bugs)
unspecified
All All
: Low normal
: VE-deploy-2014-11-19 (1.25wmf9)
Assigned To: Ed Sanders
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-10-21 15:05 UTC by Ritu Swain
Modified: 2014-11-19 23:41 UTC (History)
9 users (show)

See Also:
Web browser: Google Chrome
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Ritu Swain 2014-10-21 15:05:38 UTC
Environment- beta.

1> In VE, insert a comment. Click done.
2> click to undo while the comment is still highlighted. Notice the label on the Comment  first changes to read “Comment” from the actual comment text, before removing it. See screencast.
Comment 1 Ritu Swain 2014-10-21 15:09:50 UTC
http://youtu.be/ws3ObsyZijc
Comment 2 etonkovidova 2014-10-21 18:22:36 UTC
Confirmed in Beta(test2 and production do not have that issue).
Comment 3 Alex Monk 2014-10-22 21:45:55 UTC
This seems to be because the first undo you make only clears the comment -text- change. The second undo actually removes the comment node itself. This makes sense since you make the comment node and it goes in the document first, then later insert some text into it.
ContextItemWidget#getDescription falls back to the tool's title if the text was falsey (so, an empty string), which is why you see 'Comment' rather than an empty box. This also seems reasonable.

We should probably be removing an empty comment node from the document if it's left there due to undo... Currently this only appears to be done if you have an open comment inspector with no text and then click outside it (see CommentInspector#getTeardownProcess).
Comment 4 Roan Kattouw 2014-10-22 22:02:06 UTC
(In reply to Alex Monk from comment #3)
> This seems to be because the first undo you make only clears the comment
> -text- change. The second undo actually removes the comment node itself.
> This makes sense since you make the comment node and it goes in the document
> first, then later insert some text into it.
> ContextItemWidget#getDescription falls back to the tool's title if the text
> was falsey (so, an empty string), which is why you see 'Comment' rather than
> an empty box. This also seems reasonable.
> 
> We should probably be removing an empty comment node from the document if
> it's left there due to undo... Currently this only appears to be done if you
> have an open comment inspector with no text and then click outside it (see
> CommentInspector#getTeardownProcess).

This sounds like it was caused by Ed's "staging empty comment node" change. That code should ensure that the creation of the comment node and setting the value are one entry in the undo stack.
Comment 5 Gerrit Notification Bot 2014-11-17 13:39:49 UTC
Change 173808 had a related patch set uploaded by Esanders:
Make changes to comment node before apply staging stack

https://gerrit.wikimedia.org/r/173808
Comment 6 Gerrit Notification Bot 2014-11-17 18:15:55 UTC
Change 173808 merged by jenkins-bot:
Make changes to comment node before apply staging stack

https://gerrit.wikimedia.org/r/173808
Comment 7 etonkovidova 2014-11-18 22:04:53 UTC
Verified the fix in beta.
Comment 8 etonkovidova 2014-11-19 23:41:27 UTC
Verified the fix in test2.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links