Page MenuHomePhabricator

Content navigation links should be disabled if they link to the current URL
Open, LowestPublic

Description

Inspired by work on T95985.

Currently, navigation links get added to a page even if they point back to the exact same URL (for example, if you're editing a page, the edit tab is still a link to the page you're already on). That's not ideal, since it can confuse users by giving them a useless link that destroys their state (e.g. scroll position on the page, selections on the history page) without actually taking them anywhere. Reloading can be a valid use case, but browsers already take care of it.

We should change this so that any navigation links which point back to the exact URL of the current page are disabled and unclickable. This leaves out at least one case of self links (for example, if you're on /w/index.php?title=Main_Page, the "read" tab will still link to /wiki/Main_Page even though they're logically the same page), but it's better to leave a few useless links than to accidentally remove a few useful ones.

I've written a patch for this, and I'll now work on uploading it to Gerrit.

Event Timeline

nshahquinn-wmf claimed this task.
nshahquinn-wmf raised the priority of this task from to Needs Triage.
nshahquinn-wmf updated the task description. (Show Details)
nshahquinn-wmf set Security to None.

As a long-term user, I've come to expect these useless links and rely upon them in order to refresh the page without leaving it or hit reload (which tends to also reload some of or all the images, scripts, css etc, which is a significant difference on a slower internet connection).

Jdlrobson lowered the priority of this task from Low to Lowest.Jan 14 2021, 12:04 AM
Jdlrobson subscribed.

I'm happy to take a patch for this, but I also don't think it's of high priority.

Hello, I am a new contributor and I would like to work on this issue.
Could you guide me on where in the codebase this behavior is implemented?

Jdlrobson should know best as they added the project tag...

Hello,

I have submitted a patch for this task.

Gerrit change: https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1251897

The patch disables the navigation link when it points to the current page to avoid redundant page reloads.

Please review and let me know if any improvements are needed.

Thank you!

Hi, I’m a new contributor and I’ve been looking into this task.
I noticed a patch has already been submitted. I’d like to help improve it—especially around accessibility (e.g., adding aria-disabled and handling keyboard navigation).
Please let me know if that would be useful, or if there are specific areas where contributions are needed.