Page MenuHomePhabricator

Add a link to jump into category-editing mode
Closed, ResolvedPublicFeature

Description

Feature summary (what you would like to be able to do and where):

On the article view, we should add a small "edit" link to the category list that will open VisualEditor and immediately launch the category-editing dialog.

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):

VisualEditor has a category-editing feature. However, if someone scrolls down to the category list on an article and realizes they want to add/remove/edit the category list, it's not immediately obvious how to do so. They need to scroll back up and click an edit link, then once VE opens either know that they can click on the category list to trigger the dialog or find the "categories" item in the top-right hamburger menu.

There's a fairly popular gadget called HotCat that adds inline editing to the article-view category list, so this is clearly a feature that's desired. As I've suggested it, this wouldn't be quite as streamlined as HotCat because it'd still launch the entire VE experience, but that seems like the sweet spot for being a quick feature to implement.

image.png (546×2 px, 199 KB)

Benefits (why should this be implemented?):

Categories are useful metadata, and it's currently more difficult than it needs to be to edit them.

Event Timeline

Change 723317 had a related patch set uploaded (by DLynch; author: DLynch):

[mediawiki/extensions/VisualEditor@master] Add an \"edit\" link to categories when viewing articles

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

That patch is very much a quick prototype that didn't consider any edge cases. A little thought would need to be put into e.g. "what if the user's launching VE for the first time and is going to get the Welcome dialog".

It's on a patchdemo: https://patchdemo.wmflabs.org/wikis/7e5b73b7d1/wiki/Categorized (it's restricted to only show the link when you're logged in, since that's analogous to HotCat's availability)

Here's a quick video: https://youtu.be/OyCiaLdUd6s

We also very-recently added a highlight to the category box when in VE mode, to bring it in line with other editable block elements in VE, so we're hopefully already a bit more discoverable in terms of editing.

I rebased the patch and fixed it so it'll suppress the welcome dialog via this path. I also made sure it doesn't interfere horribly with HotCat:

CleanShot 2025-08-06 at 10.48.28@2x.png (238×1 px, 47 KB)

Test wiki created on Patch demo by ESanders (WMF) using patch(es) linked to this task:
https://bada005acb.catalyst.wmcloud.org/w/

Without gadgets, the Edit button can blend in a bit too well with the category listing, especially if the alignment is just so:

image.png (192×908 px, 60 KB)

I would suggest using the section editing link styling: square brackets, lower case and smaller font size.

You can use the mw-editsecton-like class so it doesn't get confused with real secton edit links, like we do with the TemplateData edit links ([ Edit template data ] here: https://en.wikipedia.org/wiki/Template:Italic_title#TemplateData)

I updated it with those suggestions:

CleanShot 2025-09-25 at 10.56.29@2x.png (244×1 px, 55 KB)

Change #723317 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Add an "edit" link to categories when viewing articles

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

Proposed: "An edit link will now appear inside the categories box on article pages for logged in users, which will directly launch the VisualEditor category dialog"

For users who set editing mode to "Remember my last editor", would using this feature cause VE to be remembered?

While this probably works great for people who use VE, I find it inconsistent as someone who defaults to the non-VE wikitext editor. This new edit link, otherwise identical to the rest, surprisingly opens VE instead of the expected wikitext editor.

For users who set editing mode to "Remember my last editor", would using this feature cause VE to be remembered?

It would. That could probably be changed, though I can see an argument for it going either way.

While this probably works great for people who use VE, I find it inconsistent as someone who defaults to the non-VE wikitext editor. This new edit link, otherwise identical to the rest, surprisingly opens VE instead of the expected wikitext editor.

Although showing the dialog outside of VE would probably be most-ideal, loading the VE data model is what makes this trivial (look at what HotCat does to modify categories sometime. It's kinda scary.) and we're not set up to do that in the background.

We could adjust this so it'll only show the edit link if you would have gotten VE from other edit links.

We could adjust this so it'll only show the edit link if you would have gotten VE from other edit links.

That'd be fine with me.

Change #1193964 had a related patch set uploaded (by DLynch; author: DLynch):

[mediawiki/extensions/VisualEditor@master] Only show a category edit link in read views for users who'd be given VE

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

Instead of not showing, you could also open source editor in the last known section, as by very strong convention this is where all the category links are.

Is there something ready to announce in Tech News?

Instead of not showing, you could also open source editor in the last known section, as by very strong convention this is where all the category links are.

That's probably pretty reliable, yeah. Though the failure mode for it is sort of awkward, because section editing would mean it's actually-impossible for them to find any categories that're not in that section.

For users who set editing mode to "Remember my last editor", would using this feature cause VE to be remembered?

It would. That could probably be changed, though I can see an argument for it going either way.

An editor who doesn't often switch back and forth would not expect a normal-looking [edit] link to permanently change their preference, as having the "remember" option on means that they aren't used to seeing both "edit" and "edit source" links side by side for VisualEditor and Text Editor and may not be looking for that distinction. Then, the next time that editor goes to edit a different page they will be stuck staring at the VE loading bar for a while until VE loads and they can switch back (if they even remember where the cryptic icon for switching back is).

If we don't want to add a workaround to cause the choice to not be remembered, there should at least be a "Switch to VisualEditor?" confirmation dialogue if an editor in Text Editor mode clicks the link.

Change #1193964 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Only show a category edit link in read views for users who'd be given VE

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

Okay, the category-edit will now only be shown for users who would get VE when they click an "edit" link.

EAkinloose edited projects, added Verified; removed Editing QA.

Test wiki on Patch demo by ESanders (WMF) using patch(es) linked to this task was deleted:

https://bada005acb.catalyst.wmcloud.org/w/

Test wiki on Patch demo by ESanders (WMF) using patch(es) linked to this task was deleted:

https://bada005acb.catalyst.wmcloud.org/w/