Page MenuHomePhabricator

Preferences search no longer shows results outside of the active tab
Closed, ResolvedPublic

Description

Preferences search no longer shows results outside of the active tab. Even on the active tab, something wacky is going on.

Steps to reproduce:

  1. Visit Special:Preferences
  2. Search for 'skin'

No results appear!

image.png (2×3 px, 147 KB)

Now clear the search, switch to the "Appearance" tab, and search for 'skin' again. One result appears:

image.png (2×3 px, 173 KB)

Now refresh the page (or navigate directly to Special:Preferences#mw-prefsection-rendering), and search for 'skin' again. Mutiple results appear:

image.png (2×3 px, 453 KB)

Event Timeline

This is caused by https://gerrit.wikimedia.org/r/c/oojs/ui/+/894065, and can probably be fixed by overriding some more properties for .mw-prefs-search-matched (content-visibility and the extras added in T337515). However, that will leave some HTML attributes like hidden and aria-hidden in a fairly nonsensical state, which can probably confuse accessibility tools. I think this highlights that the approach for preferences search was fragile.

Can we somehow change the tabbed layout into a continuous layout more properly while the search mode is active? There is no setter for StackLayout#continuous, but maybe we could add one.

Change 923596 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/core@master] Fix preferences search CSS overrides

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

Change 923603 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/core@master] Prefs search: Replace CSS hacks with StackLayout#setContinuous

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

I can still reproduce the second part of the problem, with either of these patches:

Now clear the search, switch to the "Appearance" tab, and search for 'skin' again. One result appears:

image.png (2×3 px, 173 KB)

Now refresh the page (or navigate directly to Special:Preferences#mw-prefsection-rendering), and search for 'skin' again. Mutiple results appear:

image.png (2×3 px, 453 KB)

…it's because the .innerText of hidden="until-found" nodes is the empty string, and so the indexing fails to process anything outside of the current tab. I guess this makes sense, and the spec even calls out this scenario as "surprising": https://html.spec.whatwg.org/multipage/dom.html#the-innertext-idl-attribute

Note: This step can produce surprising results, as when the innerText getter is invoked on an element not being rendered, its text contents are returned, but when accessed on an element that is being rendered, all of its children that are not being rendered have their text contents ignored.

Change 923596 merged by jenkins-bot:

[mediawiki/core@master] Fix preferences search CSS overrides

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

Change 923694 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/core@master] preferences search: Swap innerText → textContent for until-found compat

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

Change 923694 merged by jenkins-bot:

[mediawiki/core@master] preferences search: Swap innerText → textContent for until-found compat

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

matmarex claimed this task.
matmarex reassigned this task from matmarex to Esanders.

Change 923603 merged by jenkins-bot:

[mediawiki/core@master] Prefs search: Replace CSS hacks with StackLayout#setContinuous

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

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

https://patchdemo.wmflabs.org/wikis/3fa8690711/w/