Page MenuHomePhabricator

Beta features tab lead message in Special:Preferences doesn't play nicely with OOUI
Closed, ResolvedPublic

Description

"Here are some new features we're considering for Wikipedia. Please try them out and give us your thoughts, so we can improve them based on your feedback."

In current UI:

In OOUI:

Event Timeline

Izno created this task.Aug 30 2018, 11:20 PM
Izno triaged this task as High priority.
Izno raised the priority of this task from High to Needs Triage.

Huh, I think that's new. Pretty sure there was no double-escaping there when I last tested it.

This was caused by 2a706f4dec30ed5ff13f5421c75b400731b79202 and fixed by 2a92d52a6185fffea20723089aaa437db55739d2. Apparently, OOUI doesn't support the 'rawrow' option.

In Beta, there is a remaining problem of <tr><td …> tags appearing around the label, where they definitely should not appear (the browser ignores them).

@Umherirrender Why does this need to use 'rawrow', anyway?

The code is also used in Gadgets extension.

The whole preference tab is a table with two columns. When the text should span the whole width of the table it has to define a colspan and must avoid a empty cell for the label. OOUI is not using tables, which makes the extra colspan useless

From code review:

New html snippet:
 <tr>
 <td colspan="2"><p>[Message]
 </p>
 </td>
 </tr>
Old html snippet:
 <tr class="mw-htmlform-field-HTMLTextBlockField">
 <td class="mw-label"><label for="mw-input-wpbetafeatures-section-desc">&#160;</label></td>
 <td class="mw-input"><div>[Message]</div>
 </td>
 </tr>

It seems odd when the OOUI variants of the info field does not support the same things than the default variant.

It seems odd when the OOUI variants of the info field does not support the same things than the default variant.

It is unfortunate, but such is life. There were some edge cases where one of the modes doesn't support some option, due to technical or design limitations. I'm aware of the more similar examples:

  • In OOUI mode, HTMLTextAreaField doesn't support 'cols'
  • In non-OOUI mode, HTMLFormField doesn't support 'notices'

We could probably support 'rawrow' in OOUI mode, but it wouldn't help for Special:Preferences (at least until we change it to have only the OOUI mode), since the value would need to be different for OOUI and non-OOUI mode (wrapped in <tr><td> or in <div>).


It seems that there is already something cheeky going on on Special:Preferences#mw-prefsection-betafeatures that hides the <td class="mw-label"> element in all other table rows, so I'm pretty sure we could get away with just relying on that behavior rather than building our own <td colspan="2">.

Change 457503 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/Gadgets@master] Avoid 'rawrow' for HTMLForm 'info' fields

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

Change 457504 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/BetaFeatures@master] Avoid 'rawrow' for HTMLForm 'info' fields

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

Change 457510 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/core@master] HTMLInfoField: Support 'rawrow' in OOUI mode

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

With the last patch, OOUI-mode HTMLInfoField handles 'rawrow' correctly, but requires a FieldLayout instance to be passed rather than just any string to keep the resulting structure correct (otherwise it throws). The patches to Gadgets and BetaFeatures are needed to avoid the exception being thrown.

matmarex claimed this task.Sep 3 2018, 4:48 PM
matmarex triaged this task as Low priority.

Change 457504 merged by jenkins-bot:
[mediawiki/extensions/BetaFeatures@master] Avoid 'rawrow' for HTMLForm 'info' fields

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

Jdforrester-WMF closed this task as Resolved.

Change 457503 merged by jenkins-bot:
[mediawiki/extensions/Gadgets@master] Avoid 'rawrow' for HTMLForm 'info' fields

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

Change 457510 merged by jenkins-bot:
[mediawiki/core@master] HTMLInfoField: Support 'rawrow' in OOUI mode

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

Change 464062 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/core@master] HTMLInfoField: Undo breaking change, deprecate instead, add release notes

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

Change 464062 merged by jenkins-bot:
[mediawiki/core@master] HTMLInfoField: Undo breaking change, deprecate instead, add release notes

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