Page MenuHomePhabricator

Add id to user selector on Special:Contributions
Closed, ResolvedPublic


The input selector on Special:Contributions is the only one on the page without an id associated with it. Presumably it'd match the name, i.e. target, like the tag filter input.

Event Timeline

That looks like $input = Html::input in the includes/specials/SpecialContributions.php file of MediaWiki core.

Change 472758 had a related patch set uploaded (by Wolverine17; owner: Wolverine17):
[mediawiki/core@master] Bug ID : T208800. Added ID to the input box.

Change 472758 had a related patch set uploaded (by Wolverine17; owner: Wolverine17):
[mediawiki/core@master] Added Id to the input box

What do you need the id for?

Completion? The other selectors all have 'em. This should be carried over into T117736 but it stands out here as is. It'd be nice for anything wanting to access it to avoid $('input[name=target]'), as id is preferred for user scripts.

In general, ooui-ified items seem inconsistent as to what item get a unique id, but that's a ticket for after they're all done.

@Amorymeltzer I don't see this as needed. As long as there's no use case we shouldn't add code to be sent down to the client even if it might “feel” incomplete on a code-level. In OOUI you can assign a specific id via id: 'value' as config option or by calling setElementId for most elements (setInputId on InputWidgets).

I'd rather remove it elsewhere as well. Using ids is fragile, especially with super generic names like "target" that can easily appear in multiple places on the page (user-generated content can have arbitrary ids; it can't have arbitrary names). [name=target] is both more self-documenting and more robust IMO, and the performance difference is trivial (input field names are indexed).

That's fair, though I only suggested the poor name to match, as with other elements. I stumbled upon it while looking at en:MediaWiki:Group-sysop.js, but perhaps it's best to just deal with inconsistencies en masse after everything is converted.

Volker_E changed the task status from Open to Stalled.Jan 5 2019, 2:18 AM

Putting on “stalled” until T117736 is resolved. To be revisited after and decided if useful and needed in OOUIfied context.

I think it's harmless and easy to include in the OOUI-related changes whenever those happen.

Change 472758 merged by jenkins-bot:
[mediawiki/core@master] Added Id to the input box