Page MenuHomePhabricator

VisualEditor: For edit summary field, give users an auto-fill drop-down (or similar) of recent edit summaries they've used
Closed, ResolvedPublic8 Story Points

Details

Reference
bz48274

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Catrope removed a subscriber: Catrope.Jan 13 2016, 9:26 PM
Krinkle removed a subscriber: Krinkle.Mar 15 2016, 12:25 AM
Qgil removed a subscriber: Qgil.Mar 15 2016, 2:21 PM

I have a (very hackish) user script for providing access to previous edit summaries: https://de.wikipedia.org/wiki/Benutzer:Schnark/js/veSummary.js If anybody wants to use code from there to fix this in VE itself, feel free to do so.

Esanders raised the priority of this task from Low to Normal.Dec 14 2016, 10:17 PM
Esanders added a subscriber: Dvorapa.

Raising priority now that we have the same problem in VE source mode (NWE).

How plausible would it be to use input but magically make it word wrap, even though the HTML spec says it mustn't?

Bartosz had a go at this a few years ago, but then I pointed out some IME issues and he gave up. I think my API approach is probably the simplest.

(That was https://gerrit.wikimedia.org/r/#/c/212795/, it tried to dynamically swap between <input type=text> and <textarea>.)

It's not possible to make <input> wrap. If anything, it could be possible to make <textarea> have autocomplete (nothing in the spec prohibits it, the attribute is valid on textarea and the new 'autocomplete' values include one that is only valid on multiline content). But no browser seems to actually support this.

(Actually, Chrome does support autocomplete="street-address", huh. But that doesn't really help us here, it doesn't remember and autocomplete values in textareas on its own and there doesn't seem to be a way to make it do that.)

Jdforrester-WMF set the point value for this task to 8.
Dvorapa added a comment.EditedDec 18 2016, 3:37 PM

A solution could also be HTML5 contenteditable, at least its support in browsers is acceptable. (see StackOverflow question about this topic)

Fetch and filter recent commit messages:
https://gist.github.com/edg2s/f7db01d240ad3c83d183

I don't think that list: 'recentchanges' is the best approach, as it will only give you summaries from the last month. When you are not very active, these are very few, so won't help much. In my script https://de.wikipedia.org/wiki/Benutzer:Schnark/js/veSummary.js, I instead decided to use list: 'usercontribs' instead.
But neither will give results for users not logged in. Even if they have a static IP, mw.user.getName() will only return null.

But neither will give results for users not logged in. Even if they have a static IP, mw.user.getName() will only return null.

There are a bunch of features that don't work for logged-out users; I'd not worry too much about that.

Deskana moved this task from TR1: Releases to Freezer on the VisualEditor board.Oct 27 2017, 3:18 PM

According to https://developer.mozilla.org/en-US/Firefox/Releases/59#HTML Firefox now supports autocompletion of textareas, so it should actually be possible to have native autocomplete suggestions, at least in Firefox.

Izno added a subscriber: Izno.Nov 3 2018, 3:44 AM

Change 495451 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/VisualEditor@master] Edit summary autocomplete

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

Izno added a comment.Mar 9 2019, 5:15 PM

Change 495451 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/VisualEditor@master] Edit summary autocomplete
https://gerrit.wikimedia.org/r/495451

Why doesn't this make use of T50274#4048873 ? It looks like Firefox, Webkit, and Chromium all support autocomplete (even though Mozilla.org indicates otherwise, the link to the Chromium indicates the bug is fixed since Jan 2018)...

It doesn't appear to work yet in Chrome/FF: https://codepen.io/edg2s/pen/eXGdVM

It doesn't appear to work yet in Chrome/FF: https://codepen.io/edg2s/pen/eXGdVM

Nor in Safari.

Change 495451 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Edit summary autocomplete

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

greg removed a subscriber: greg.Apr 4 2019, 9:40 PM
Esanders moved this task from Inbox to Low Priority on the Editing QA board.Apr 9 2019, 12:46 PM
ToBeFree added a subscriber: ToBeFree.

Wonderful and seems to be done

Trizek added a subscriber: Trizek.Apr 12 2019, 8:56 AM

Great feature. <3
Can we have a way to delete misspelled sentences? Thanks!

Izno added a comment.EditedApr 12 2019, 2:51 PM

I agree, this is well done.

My only problem: when I have entered a summary, the drop down appears. When I hit the hotkeys for save, the system will complete the summary with the top item whatever the value of my original summary was. (This is not how it works in old WTE.)

The particular issue was that I wanted a summary of "clean table", but after having entered the entire thing in it removed the exact match and attempted to add the lengthier summary after hitting cntrl + enter, and then chose not to save. (The biggest win for me is that the hotkeys should always save regardless of the current value of the dropdown.)

Happy to split this to a different task if it seems like a significant chunk of additional work...

Great feature. <3
Can we have a way to delete misspelled sentences? Thanks!

No. But if you make 200 more edits, it'll automagically go away. The tool only looks back at your most recent 200 edit summaries.

Whatamidoing-WMF added a comment.EditedApr 12 2019, 6:43 PM

@Esanders, Izno's problem is going to drive me nuts. When there's an exact match, it needs to use that exact match, and not suggest something longer. If I've typed r, and the options it finds are 35 instances of r and one of Re-ping in my last 200 edit summaries, then it should definitely be suggesting r and not the other longer one.

(In the meantime, the workaround is to hit the Escape key.)

Izno added a comment.EditedApr 12 2019, 7:51 PM

(In the meantime, the workaround is to hit the Escape key.)

(And then hit Ctrl + Enter again.)

TheDJ added a subscriber: TheDJ.Apr 15 2019, 1:23 PM

Great feature. <3
Can we have a way to delete misspelled sentences? Thanks!

No. But if you make 200 more edits, it'll automagically go away. The tool only looks back at your most recent 200 edit summaries.

So I have to be patient. And be careful: I've already accidentally entered some bad summaries while editing. :/

My only problem: when I have entered a summary, the drop down appears. When I hit the hotkeys for save, the system will complete the summary with the top item whatever the value of my original summary was. (This is not how it works in old WTE.)

This is a big problem for me as well. My most common summary on talk pages or project discussion pages is just “reply”, but the first suggestions are all like “reply (something something)”, “reply, something else”, etc. When I press Ctrl+Enter out of habit – for years, VisualEditor has trained me that Ctrl+Enter in the summary field means “save” – then it will “complete” my edit summary with some gibberish that makes no sense in the current context, and if I don’t notice it I’ll save an edit with a nonsense summary.

Is it possible to opt out of this feature until that’s fixed?

Great feature. <3
Can we have a way to delete misspelled sentences? Thanks!

The edit summaries are pulled from the API and old edit summaries are immutable so I don't see an easy fix for this without using another storage system. Suggestions welcome.

Is it possible to opt out of this feature until that’s fixed?

No, but it shouldn't be too hard to fix. In the meantime you can press escape before ctrl+enter.

Change 506191 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/VisualEditor@master] EditSummaryWidget: Don't highlight first automatically

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

The above patch stops the first item being highlighted automatically. You can test the effect on live by pasting ve.init.target.saveDialog.editSummaryInput.lookupHighlightFirstItem = false; into the console after the save dialog has opened.

Change 506191 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] EditSummaryWidget: Don't highlight first automatically

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

Izno added a comment.Apr 24 2019, 8:13 PM

The above patch stops the first item being highlighted automatically. You can test the effect on live by pasting ve.init.target.saveDialog.editSummaryInput.lookupHighlightFirstItem = false; into the console after the save dialog has opened.

BTW since you're in the area there's a TODO there that was waiting on what is now a task that you closed a week or two ago.

BTW since you're in the area there's a TODO there that was waiting on what is now a task that you closed a week or two ago.

Sorry, I'm not sure what you're referring to, can you provide a link?

Izno added a comment.EditedApr 25 2019, 1:39 AM

BTW since you're in the area there's a TODO there that was waiting on what is now a task that you closed a week or two ago.

Sorry, I'm not sure what you're referring to, can you provide a link?

	// HACK: Disable pending animation. Should be made an upstream option (T220204)
	// Parent method

T220204: Make pushPending optional on OO.ui.mixin.RequestManager / OO.ui.mixin.LookupElement widgets

@Izno Now done in https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/VisualEditor/+/512227. I think we were still waiting for MediaWiki to be updated to use the new version of OOUI of something.

Izno added a comment.May 23 2019, 9:17 PM

The above patch stops the first item being highlighted automatically. You can test the effect on live by pasting ve.init.target.saveDialog.editSummaryInput.lookupHighlightFirstItem = false; into the console after the save dialog has opened.

This worked nicely. Thanks much!

@Izno Now done in https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/VisualEditor/+/512227. I think we were still waiting for MediaWiki to be updated to use the new version of OOUI of something.

Coolio.

Dvorapa added a comment.EditedMay 23 2019, 9:31 PM

It works nicely!

TheDJ added a comment.Jun 21 2019, 1:26 PM

Do we consider this fixed now then ?

ppelberg closed this task as Resolved.Jun 27 2019, 5:00 AM
ppelberg claimed this task.