Page MenuHomePhabricator

Installer Codex message box is now one character wide
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Set up a MediaWiki source tree with no skins
  • Open the web installer and proceed to the options page

What happens?:

An error message is shown, with the text of the error being forced into a div which is one character wide.

codex 1.png (767×996 px, 26 KB)

The help box immediately below is also affected. However, the other help boxes on the page are not affected despite having similar HTML. I don't understand what is different about the affected divs.

outerHTML

<span class="cdx-card"><span class="cdx-card__text"><span class="cdx-card__text__title">Skins</span><span class="cdx-card__text__description">
<div class="cdx-message cdx-message--block cdx-message--warning config-warning-box"><span class="cdx-message__icon"></span><div class="cdx-message__content">No skins were found; MediaWiki will use a fallback skin until you install some proper ones.</div></div><input type="hidden" value="vector-2022" name="config_wgDefaultSkin"><div class="config-help-field-container">
<a class="config-help-field-hint" title="click to expand">ℹ️ help</a>
<div class="config-help-field-content cdx-message cdx-message--block cdx-message--notice" style="margin: 10px"><div class="cdx-message__content">The skins listed above were detected in your <code>./skins</code> directory. You must enable at least one, and choose the default.</div></div>
</div>
</span></span></span>

The box model in Firefox dev tools shows the computed size of the div.cdx-message__content with "no skins were found" being 0×1945.6.

What should have happened instead?:

codex 2.png (145×999 px, 14 KB)

This screenshot was constructed by removing the width: 0 rule from cdx-message__content, which if I understand correctly, is equivalent to reverting gerrit 1060772.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

git master 5bb154a8780989d379741cf4dad11b3b0f3fa58f

Other information (browser name/version, screenshots, etc.):

Confirmed in Firefox and Chromium.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

@tstarling thanks for reporting this. One issue is that the message, which has a div as its root element, is being placed in a series of spans - we don't typically expect or recommend that block elements to be inserted into inline elements. Setting display: block on the .cdx-card selector should make the Message component take up the appropriate amount of space - I'd recommend this over unsetting the width: 0 rule, which was put in place to ensure that long strings like URLs wouldn't overflow the message container, if possible to resolve this task.

That said, the width: 0 rule is not ideal due to the potential to cause issues like this one. It was meant to be a temporary fix until we resolve the larger issue of handling/breaking long strings in Codex components (see T372896). That task is up next for DST, and I've added removing the width: 0 rule as an acceptance criterion.

I probably copy-pasted the spans from the example and didn't notice they had divs inside them. I don't think those need to be inline elements, we probably can switch them. I will try to fix it with other changes ASAP.

Change #1109523 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):

[mediawiki/core@master] installer: Adapt web installer with the codex changes

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

Maybe I'm doing it wrong but setting all cdx cards elements to <div> to make them block elements didn't fix the issue:

grafik.png (859×1 px, 192 KB)

I upload the patch regardless since it should be div anyway.

Volker_E renamed this task from Installer codex message box is now one character wide to Installer Codex message box is now one character wide.Sat, Jan 11, 4:29 AM

Change #1109523 merged by jenkins-bot:

[mediawiki/core@master] installer: Adapt web installer with recent Codex changes

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

Ladsgroup reopened this task as Open.
Ladsgroup claimed this task.

I forgot, this doesn't fix the issue. My apologies.

I forgot, this doesn't fix the issue. My apologies.

In that case, you might just add width: unset to the cdx-message__content selector for now. We're working on removing the width: 0 rule from the Codex Message code (as part of T372896) but may not have that completed for a few weeks due to the team's schedule, so a workaround is warranted IMO.

OTOH, we are not going to have a mw release for the next couple of months and this specific case is rather rare (tarball automatically includes Vector) so I personally think it's fine for a couple of weeks. But if Tim disagrees, I can set it (and then revert it later).