Page MenuHomePhabricator

User talk pages auto launch into edit source mode (caused by Twinkle)
Closed, ResolvedPublic

Description

I reset all my preferences/settings during the T192755 bug. Now when I rollback and go to warn the User, the User TalkPage automatically launches in edit source mode and not the static (read) mode I am used to. This also happens when I click on non-existent pages/redlinks. I posted on Village pump's technical page but never received any assistance. I then posted at the Help Desk and was advised to post the issue here. Any ideas as to what is going on? Do I have something accidentally selected in my preferences or is this a bug? I am primarily an English language Wikipedia user, it is hard to tell but it appears that this does not happen when I am on the German Wikipedia or Wikimedia Commons. Thanks in advance for the assistance.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 29 2018, 8:10 PM
Cirdan added a subscriber: Cirdan.

This might be the same issue that Johnywhy is experiencing in T195761: Bug: When a Talk Page is Refreshed After Saving Edits, it Re-Enters Edit-Mode.

It immediately launches in edit source mode for me rather than after refresh.

Vvjjkkii renamed this task from Redlinks auto launch into edit source mode to 90baaaaaaa.Jul 1 2018, 1:07 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
CommunityTechBot renamed this task from 90baaaaaaa to Redlinks auto launch into edit source mode.Jul 2 2018, 3:19 PM
CommunityTechBot raised the priority of this task from High to Needs Triage.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added a subscriber: Aklapper.

As I just posted on WP:VPT, I use the following snippet in my common.js to neutralize the annoying behavior:

(function() {
    var len = document.links.length;
    for (var i = 0; i < len; ++i) {
        var l = document.links[i];
        if (l.href.indexOf('&redlink=1') > -1) {
            l.href = l.href.replace('&action=edit', '');
        }
    }
})();

Essentially, we would like to be able to disable the default behavior of automatically opening redlinks in edit mode.

Edit: Not every redlink I visit is destined to be created. Sometimes I may just want to see the deletion log, or I'm using Twinkle and don't need the editor. With the default behavior, I had to wait for the JS heavy Visual Editor to load, then close it, or trim &action=edit from the URL manually. I seem to recall a long time ago, that redlinks were not automatically opened in an editor. Perhaps we can add an option to get that behavior back?

To keep this updated and alive.

The following code was used to neutralize auto-opening redlinks.

mw.hook("wikipage.content").add(function() {
  $("a.new").each(function() 
  {
    this.href = this.href.replace("&action=edit","");
  });
});

The clarify the only issue that remains is that when I hit the Twinkle rollback(AGF)/rollback/rollback(vandal) button two things happen. First, the page reverts the edit back and reloads; second, the offending user's talk page opens in a new tab. The user's talk page now automatically opens in edit mode, instead of read mode. This didn't use to be the case for me. It adds time in issuing warning for the edits because it slows my computer down to open in straight edit mode. Looking for a way to prevent that without turning off the New Wikitext mode. When I toggle New Wikitext mode off the issue resolves. Any solutions to this?

Also repeating here: that snippet above using just an a.new selector only works for redlinks in the page body (since they're only generated inside mw-parser-output). It will still leave links with &action=edit elsewhere in the interface (article/talk page tab, edit history, contribution history, log entries) if the page is nonexistent. Adding an option to not open the new wikitext editor in edit mode on new pages would be helpful.

To explain a little further, having to switch between turning VE source editing and an older editor is burdensome for me, I don't know if others feel the same way. Often in anti-vandalism patrolling you stumble upon new users who do not cite their sources or make a simple mistake in a positive contribution to the project. I could revert that user for lacking citations or any other guideline they did not adhere to, but I fear that it will scare away a clearly good faith editor. VE's automatic citation tool is vastly superior. I am less inclined to assist problematic edits or I can not attend to as many as I would like, if I have to switch back and forth. Auto-opening in source mode not only slows down the computer because of VE, but it can make it more difficult to see what level of warning a vandal has received on their talk page, which ultimately slows down anti-vandalism patrolling.

The clarify the only issue that remains is that when I hit the Twinkle rollback(AGF)/rollback/rollback(vandal) button two things happen. First, the page reverts the edit back and reloads; second, the offending user's talk page opens in a new tab. The user's talk page now automatically opens in edit mode, instead of read mode. This didn't use to be the case for me. It adds time in issuing warning for the edits because it slows my computer down to open in straight edit mode. Looking for a way to prevent that without turning off the New Wikitext mode. When I toggle New Wikitext mode off the issue resolves. Any solutions to this?

I've looked at Twinkle's code to see what it does: https://github.com/azatoth/twinkle/blob/e0f3d9c1ab5bfa1d1ef2e421e071a6cb977b2b4d/modules/twinklefluff.js#L439

Essentially, it opens URLs like this: https://en.wikipedia.org/wiki/User_talk:Matma_Rex?action=edit&preview=yes. This URL will open the editor regardless of which one you're using – but in old wikitext editor, the 'preview=yes' parameter causes it to show a preview of the page before the editor area. We don't really have a way to do it in new wikitext editor, due to the different design of the save dialog – but we could just blacklist the 'preview' parameter, which will result in the old editor opening and working as you expect.

matmarex renamed this task from Redlinks auto launch into edit source mode to User talk pages auto launch into edit source mode (caused by Twinkle).May 18 2019, 4:14 PM

Change 511060 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/VisualEditor@master] VisualEditorHooks: Mark the 'preview' parameter as unsupported

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

Change 511060 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] VisualEditorHooks: Mark the 'preview' parameter as unsupported

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

matmarex closed this task as Resolved.May 19 2019, 6:12 PM
matmarex claimed this task.