Page MenuHomePhabricator

Namespace checkboxes on old search interface don't align well on Chrome and Safari
Closed, ResolvedPublic

Description

Here are the screenshots of the Advanced tab of the old search interface via Google Chrome (current ver. 97.0.4692.99)

old advanced search interface (3).png (510×1 px, 3 MB)
Max wide
old advanced search interface (2).png (588×690 px, 2 MB)
Wide
old advanced search interface (1).png (592×612 px, 2 MB)
Narrow

The boxes seen in two screenshots look awkward and may not align well, depending on how you adjust Google Chrome's window size.

Strangely, no issues with namespace checkboxes while using Firefox (current ver. 96.0.3)

old advanced search interface (firefox).png (519×1 px, 3 MB)

Probably this is OOUI- or Chrome-related?

To test this out, first disable the Advanced Search via user preferences.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
gh87 renamed this task from Namespace checkboxes on search engine don't align well on Google Chrome to Namespace checkboxes on old search interface don't align well on Google Chrome.Jan 31 2022, 9:18 PM
gh87 updated the task description. (Show Details)
matmarex moved this task from Unsorted to mediawiki.ui on the UI-Standardization board.
matmarex subscribed.

These are actually "MediaWiki UI" checkboxes, predating OOUI.

This looks like it might be a browser bug, caused by the use of CSS multi-column layout (added in https://gerrit.wikimedia.org/r/c/mediawiki/core/+/747983 a few weeks ago), I recall other issues with it in the past in Chrome.

I've looked into this. The issue seems to be that although we removed the table layout from the columns, the individual checkbox/label pairs are still set to display: table; , which causes them to wrap to the next column.

we can change this by setting checkbox/label pairs to display: flex; which seems to wrap without breaking the inputs.

.mw-ui-checkbox {
     display: flex;
    flex-wrap: wrap;
    margin-bottom: 0.5em;
}
EJoseph subscribed.

Awesome I would implement

I created a patch to convert the checkboxes to OOUI in order to fix T301500, it looks like that also fixes this.

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

[mediawiki/core@master] Convert SearchFormWidget namespace checkboxes to OOUI

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

@matmarex That all looks pretty good. One usability must-have issue to fix:

BeforePatched
image.png (764×2 px, 121 KB)
image.png (814×2 px, 131 KB)

One nice-to-have: The buttons for selecting/deselecting should be OOUI ones too.

gh87 renamed this task from Namespace checkboxes on old search interface don't align well on Google Chrome to Namespace checkboxes on old search interface don't align well on Chrome and Safari.Feb 16 2022, 2:33 AM

No longer limited to Google Chrome. The problem also extends to Apple Safari, but I'm unsure whether the patch can work also for Safari. My Safari version is 15.3.

Screen Shot 2022-02-15 at 6.30.58 PM.png (1×1 px, 779 KB)
Screen Shot 2022-02-15 at 6.31.37 PM.png (1×2 px, 813 KB)
Screen Shot 2022-02-15 at 6.30.34 PM.png (1×1 px, 752 KB)

The problem seemed interesting to me, so I experimented a little trying to get to the bottom of this.

Here's a small demo that shows what is happening: https://test.wikipedia.org/wiki/T300574

ChromeFirefox
image.png (1×2 px, 79 KB)
image.png (1×2 px, 85 KB)

Chrome supports splitting tables across multiple columns (unlike Firefox). However, the way it picks the "break points" is not very smart; in particular, it will happily break in the middle of a cell, even if this is a single-cell table.

As it happens, each checkbox on Special:Search is actually a tiny table, and that's why they are affected by this. I think I was wrong to call this a bug in T300574#7667793 though, it's just a little weird.

The suggestion to change them into flex boxes from T300574#7701605 probably wouldn't work; as demonstrated above, Chrome is also happy to break columns in the middle of flex boxes.

Changing them into OOUI checkboxes (T300574#7705774) doesn't work either, each one of them is also a tiny table. The column breaking is slightly different and less obviously broken, but it's still not great (T300574#7710681).

However, there is a fix that works – we can just instruct it to not break columns inside of the table cells! I will submit a patch that does this.

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

[mediawiki/core@master] mediawiki.special.search.styles: Don't break columns inside checkboxes

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

Change 765542 merged by jenkins-bot:

[mediawiki/core@master] mediawiki.special.search.styles: Don't break columns inside checkboxes

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

When will this be deployed? I still see the issue as of date.