Page MenuHomePhabricator

MediaWiki Code Splitting: ensure that CSS specificity works as expected
Closed, ResolvedPublic1 Estimated Story Points

Description

After this week's Codex release rides the MW train, we should test that things work as expected in the context of a consuming MW extension.

Test steps

The CodexExample extension has already been updated to use the new codexComponents option in its extension.json. With the latest version of CodexExample installed, it is possible to navigate to Special:CodexExample and see the following:

Capture-2024-01-08-142308.png (2×2 px, 285 KB)

The screenshot above, captured before the patch that fixes T351753 has been released. The broken styles on the TypeaheadSearch component at the top of the page are clearly visible.

After the release of Codex 1.2.1 (scheduled for tomorrow – Jan 9), this problem should go away.

Acceptance criteria
  • Loading the Codex bundle as part of the special page should not break the styling of the TypeaheadSearch widget (which is loaded as part of Vector).
Current status

As of Friday Jan 12 (after the release of Codex 1.2.1), I can see that the most egregious form of the breakage has been fixed.
However, it still looks like the TypeaheadSearch styles are slightly off – note the border radius on the top left corner of the drop-down menu after code-splitting bundles have been loaded:

Screenshot 2024-01-12 at 12.52.11 PM.png (344×1 px, 44 KB)

This is how the TypeaheadSearch component looks on a page where code splitting is not used (this is the correct appearance):

Screenshot 2024-01-12 at 12.52.26 PM.png (328×1 px, 43 KB)

Looks like the TypeaheadSearch menu styles needed the extra specificity treatment:

// before
.cdx-typeahead-search {
    &__menu {}
}

// should be
.cdx-typeahead-search {
    &__menu.cdx-menu {}
}

This patch should fix the issue.

Event Timeline

AnneT triaged this task as High priority.Jan 8 2024, 6:22 PM
AnneT set the point value for this task to 1.
egardner renamed this task from [placeholder] test code splitting to MediaWiki Code Splitting: ensure that CSS specificity works as expected.Jan 8 2024, 6:27 PM
egardner updated the task description. (Show Details)

Change 990245 had a related patch set uploaded (by Eric Gardner; author: Eric Gardner):

[design/codex@main] TypeaheadSearch: Increase specificity of menu CSS overrides

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

Change 990245 merged by jenkins-bot:

[design/codex@main] TypeaheadSearch, styles: Increase specificity of menu CSS overrides

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

Change 992533 had a related patch set uploaded (by Eric Gardner; author: Eric Gardner):

[mediawiki/core@master] Update Codex from v1.2.1 to v1.3.0

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

Change 992533 merged by jenkins-bot:

[mediawiki/core@master] Update Codex from v1.2.1 to v1.3.0

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