Page MenuHomePhabricator

Reconsider address bar URL changes done on historical Visual Diff page
Closed, ResolvedPublic

Description

Currently, when a user has Visual Diffs enabled for historical diffs (beta feature), the JS changes the URL of all diff pages to include the current mode as diffmode parameter. This is even done for the initial loading, i.e. even when the user doesn't change diffmodes, the URL will still be changed.

When users share links to diffs, they usually just copy the whole URL. Since that URL includes the diffmode parameter, there mode will be forced on other users. While in some cases this is the desired behavior, in most cases users just want to share the diff, not the exact mode. This is a bit annoying for other users, to have their preferred diff mode changed (and not only for that diff, but for all diffs until the explicitly change it again) just because they followed a link.

The best solution of course would be if users copied only part of the URL, omitting the diffmode parameter if they just want to share a link and only include it if they want to share the exact mode, too, but that's probably not going to happen, so the Visual Diffs should change their behavior instead.

Either the URL should never be adapted. This way, users never will share the diffmode if they don't really want to. They could still add that parameter manually, if they want to link to the exact mode, but - this is the disadvantage - they have to know about the parameter to do so. On the other hand, many other parameters aren't easily discoverable as well, so this wouldn't be very bad in comparison.

Or the URL should only be adapted when the user changes the diffmode, but not for initial loading. This would make it unlikely that URLs with accidental diffmode parameters are shared, while it would be automatically included in most cases where a user wants to share the exact mode.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Schnark renamed this task from Feconsider URL changes done by Visual Diff to Reconsider URL changes done by Visual Diff.Jan 11 2019, 8:41 AM

This would make it unlikely that URLs with accidental diffmode parameters are shared, while it would be automatically included in most cases where a user wants to share the exact mode.

I don't think this works, because the diffmode is remembered in user options. This would effectively stop the diffmode ever being appended after the first time the user changes it to their preference. If the user wanted to share a diffmode they would have to change the mode twice.

This would make it unlikely that URLs with accidental diffmode parameters are shared, while it would be automatically included in most cases where a user wants to share the exact mode.

I don't think this works, because the diffmode is remembered in user options. This would effectively stop the diffmode ever being appended after the first time the user changes it to their preference. If the user wanted to share a diffmode they would have to change the mode twice.

The circumstances under which a user which a user wants to share the explicit diffmode which I can think of are something like "There is a bug/unclear display with that mode, but the other mode looks good", and in these cases users indeed changed the mode twice or even more often to compare.

and in these cases users indeed changed the mode twice or even more often to compare.

That seems a little flaky. I would rather we always set the param, or never set it.

Esanders renamed this task from Reconsider URL changes done by Visual Diff to Reconsider address bar URL changes done on historical Visual Diff page.Jan 19 2022, 1:59 AM

Then never set it. There are tons of user preferences that can be overridden through URL parameters (UI language, skin, whether to show preview when starting to edit etc.), yet none of these are automatically added to the URL, without the user doing anything. Now that visual diffs are default on most wikis (T314588), the only way to prevent VisualEditor from rewriting my URLs is entirely disabling JavaScript on WMF wikis, which I don’t want to do (or overriding history.replaceState and hoping that I don’t run into a race condition, but that’s even more hackish). If you want users to know about this parameter (which, as @Schnark said, should be very very rarely needed), you could add a help link and explain the parameter on the help page.

matmarex subscribed.

I'd like us to take another look at this after historical visual diffs are out of beta everywhere (scheduled for tomorrow on T314588), let's say a week or two from now, and either make changes or reject this depending on user feedback. @Tacsipacsi @Schnark If you see anyone mention it somewhere on-wiki in your language, it'd be helpful to see.

In my experience people who want "pretty" links already format them using [[Special:Diff/NNN]] most of the time, and in other cases knowing the diff mode will be helpful to understand what the other person was seeing; but if it turns out to be problematic or disliked, I don't think we'd lose much by removing this behavior.

In my experience people who want "pretty" links already format them using [[Special:Diff/NNN]] most of the time

I don’t; I try to use [[Special:Diff/NNN]] only if absolutely necessary (e.g. in edit summaries), because it omits an important piece of information: what page the diff is on. I can’t see the page title if I just hover over the link, and I can’t see it at all if the revision has been deleted (nor the delete log, as that’s connected to pages, not revisions).

In my experience people who want "pretty" links already format them using [[Special:Diff/NNN]] most of the time

I copy links to diffs off-wiki a lot, so my personal script condenses them just to bare essentials, i. e. https://ru.wikipedia.org/?diff=1. Then comes the visual diff feature and adds its stuff to it. I don’t really see how the diff mode choice can be relevant in diff links, people usually link to diffs to convey information (e.g., linking to each other’s comments, linking to a problematic edit, etc.), not to show how something looks in the diff on their end. (Left a comment on another task that this URL fiddling is why I want to disable this feature.)

https://phabricator.wikimedia.org/T314588#8749209 brought me here.

Agree with the above comments. I initially thought about removing the parameter addition only on page load, but it would be even better to remove the parameter addition in all cases (i.e. also when using the toggle).

About the [[Special:Diff/NNN]], I also prefer to not use it in page content:

  • it doesn't show the page title
  • it makes an HTTP redirect
  • it is formatted as an internal link, contrarily to the widespread diff links which are formatted as external links

Editing-team discussed this today in a meeting and we agree that the 'diffmode' parameter should not be added to the URL if missing, neither on initial load nor after changing the diff mode. It should still be usable for choosing the diff mode when added to the URL manually (and in existing links). Thanks for the comments, all.

Change 908390 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/VisualEditor@master] Stop adding the 'diffmode' parameter to the URL

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

Change 908390 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Stop adding the 'diffmode' parameter to the URL

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

EAkinloose edited projects, added Verified; removed Editing QA.