Page MenuHomePhabricator

Direct link to a setting in Special:Preferences
Closed, ResolvedPublic

Description

Special:Preferences should support a URL parameter that makes it open to a specified user preference, rather than just starting on the "General" tab. For example:

http://example.com/wiki/Special:Preferences?pref=showtoc

would cause Special:Preferences to open with its Appearance tab active, since that is where the "showtoc" (Show table of contents) checkbox lives.

This would be a great help with documentation. Instead of wiki pages saying, "Click My Preferences, then click the Appearance tab," they can provide a direct link to the setting in question.

This feature opens the doors to useful doc templates like this one:

Change the setting "{{MediaWiki:tog-{{{1}}}}}" by clicking [{{fullurl:Special:Preferences|pref={{{1}}}}} HERE].

This request is related to bug 27559, which asks for Special:Preferences to open a specified tab. My suggestion abstracts away the tab and focuses on the preference setting itself... after all, the Preferences UI could change someday (say, changing tabs into something else), but the preference names are not likely to change.


See Also:
T69846: One-click system for setting user preferences

Details

Reference
bz32811
TitleReferenceAuthorSource BranchDest Branch
Remove unused "Harbormaster" application from default settingsrepos/phabricator/deployment!27aklapperT348115-harbormasterwmf/stable
Default start offset for kafka sourcesrepos/search-platform/cirrus-streaming-updater!40pfischerdefault-kafka-start-offsetsmain
Customize query in GitLab

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 12:01 AM
bzimport set Reference to bz32811.
bzimport added a subscriber: Unknown Object (MLST).

Finding an element and then finding out which tab it's in *should* be pretty straightforward; I'm adding bug 27559 as a dependency here since this should be just an extension of the code needed there.

Dan: Isn't this kind of fixed by being able to link to the first section in a tab, e.g. for "Appearance" https://www.mediawiki.org/wiki/Special:Preferences#mw-prefsection-rendering ?
I'd close this as RESOLVED WORKSFORME as it seems to be good enough.

This is now possible by linking to Special:Preferences#tabname.

Reopening: linking to a tab and linking to a preference are not the same thing. Some preference tabs are a jumble of dozens of esoteric options, forcing the user to figure out which one they have to change is not helpful at all. There should be a way to link to a specific preference, and that should create some sort of visual highlighting to that preference.

The simplest implementation would be using Special:Preferences#<input element id>, then a script would locate the input element, open the parent tab, scroll the element into view, and add a yellow background to its container element ( $(element).closest('[id^=mw-htmlform-field-]') at first glance).

You can now link to setting fieldsets via their ID, which should be sufficient for deep-linking for power users, for example https://en.wikipedia.org/wiki/Special:Preferences#mw-prefsection-rc-optoutrc

From a user perspective I don't think it makes sense to fine-grain this even further down to a specific setting, as the context is useful to be shown as well.

We won't expose a link marker though as it would unnecessary clutter the interface for a rarely used power user feature to all users.

From a user perspective I don't think it makes sense to fine-grain this even further down to a specific setting, as the context is useful to be shown as well.

The use case is help pages which link to a specific setting (which then the user has to find in the not-exactly-user-friendly mess of Special:Preferences). Which might have different text than the help page (since those are rarely kept in sync with translations) etc.

An anchor would not be a good solution for that, sure; probably some kind of JS-based highlighting should be used instead. Select the right tab, scroll it if necessary so the preference is within view, and then change the background color of the preference to light yellow, or something like that.