Page MenuHomePhabricator

UploadWizard: update URL for consistent ?categories=
Open, Needs TriagePublicFeature

Description

Premising that UploadWizard already supports some nice URL parameters, including a ?categories=Foo|Bar to prefill these categories, and more:

https://commons.wikimedia.org/wiki/Commons:Upload_Wizard/Fields_prefilling

And premising that this prefilling is just great 🥰

The next natural step is about easily building correct URLs, possibly not manually, and possibly not using external tools, and possibly not creating more confusing user interfaces. So, the idea:

Feature summary: when interacting with categories, auto refresh the page URL to have consistent ?categories

When interacting with UploadWizard multimedia files:

  • WHEN:
    • every time a category picker is changed (for example, when you pick Category:One)
    • or, every time a category is unpicked
    • or, every time you click on Copy selection to other uploads
  • WHAT:
    • list all categories in use by all files, and mention these in the URL ?categories= 🎉

Use case FAQs:

Use case(s)

After you successfully upload some files:

  • be able to copy the UploadWizard URL and bookmark it, to quickly re-use that context again for consequent uploads
  • be able to share the UploadWizard URL to others, etc.

Benefits:

  • non-technical users can easily upload images with same categories later (by just copy-pasting the URL)
  • more people will be aware the existence of ?categories= and the concept of "fields prefilling" in general - as it would be somehow self-documented
  • the URL will be arguably more consistent with the represented situation
  • backward compatibility - the user interface remains unchanged

Implementation tips

The JavaScript "pushState" API is widely available in browser webs and allows to update the URL without reloading the page:

https://developer.mozilla.org/en-US/docs/Web/API/History/pushState

(💡 Fun fact: the "pushState" technology is also used by Wikimedia Phabricator every single time we click on whatever internal link. When you click on links, we are really not visiting a different Phabricator URL, but the URL is refreshed and some Phabricator page content is refreshed. This thing was discovered during a fix for the "infinite rickroll" bug. You're welcome! lol - source: https://we.phorge.it/D26722 )

Tips for newcomers (example: Hackathon newcomers)

These sounds like the necessary things to be able to implement this feature:

  • be happy about having a local MediaWiki in your computer, for tests
  • some JavaScript knowledge
  • some git knowledge (clone, commit)

The current git source code is here, in Wikimedia Gerrit:

https://gerrit.wikimedia.org/g/mediawiki/extensions/UploadWizard

Event Timeline

valerio.bozzolan renamed this task from UploadWizard URL field prefilling: have URL adhering HTML inputs (at least for categories) to UploadWizard: update URL for consistent ?categories=.Jul 15 2026, 9:54 AM
valerio.bozzolan updated the task description. (Show Details)

Not implemented during the hackathon :3 maybe next one

Change #1348765 had a related patch set uploaded (by Simon04; author: Simon04):

[mediawiki/extensions/UploadWizard@master] Reflect common categories in the ?categories= URL parameter

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