Skip to content

Restore loading of vector-fix CSS modules#85

Merged
malberts merged 2 commits into
5.xfrom
fix/modal-backdrop-skin-loading
May 22, 2026
Merged

Restore loading of vector-fix CSS modules#85
malberts merged 2 commits into
5.xfrom
fix/modal-backdrop-skin-loading

Conversation

@malberts
Copy link
Copy Markdown
Collaborator

@malberts malberts commented May 21, 2026

Two commits, two concerns. Fixes #84.

1. Restore loading of vector-fix CSS modules — af96510

The replacement sparse-loading foreach added in #80 (HooksHandler::onParserAfterParse) called getModulesFor( $activeComponent ) without a skin argument, returning only the default module group. The Vector-fix modules live in the vector group and were therefore silently dropped on every skin. Adding back 'vector' reinstates the per-skin group that AbstractComponent::augmentParserOutput() had been passing since 5.2.0 (commit f5a9c9f) — the path that MW 1.43's ParserOutputAccess lifecycle change silently disabled, which is precisely what #80 set out to compensate for via the post-parse hook.

2. Drop heavy mock-based test for the post-parse module loader — c0ac01b

Per Jeroen's review on #80, the test that landed alongside the sparse-loading patch pinned a single argument literal through deep mocks of every collaborator on HooksHandler, coupling to call signatures rather than behaviour. Integration verification on the running rig is the more reliable signal for this regression.

@malberts malberts force-pushed the fix/modal-backdrop-skin-loading branch 2 times, most recently from c11b59b to 5d33b66 Compare May 21, 2026 21:37
@malberts
Copy link
Copy Markdown
Collaborator Author

malberts commented May 21, 2026

For the record on the "previous behaviour" framing in the commit
message: the 5.2.x line has loaded modal.vector-fix /
popover.vector-fix for every skin (not just Vector-family ones)
since f5a9c9f ("did some refactoring", 2024-07-13),
which first shipped in 5.2.0. That commit changed
AbstractComponent::augmentParserOutput()'s call from

$this->getComponentLibrary()->getModulesFor(
    $this->getComponentName(),
    $this->getParserOutputHelper()->getNameOfActiveSkin()
);

to

$this->getComponentLibrary()->getModulesFor(
    $this->getComponentName(),
    'vector'
);

alongside the broader BootstrapComponentsService refactor. So this
PR restores the documented 5.2.x behaviour by routing the same
hard-coded 'vector' through the post-parse hook (the only path
that survives MW 1.43+'s ParserOutputAccess lifecycle change). A
principled redesign — passing the active skin, deciding which
skins actually need the workaround, possibly retiring
top: 60px for non-Vector chromes — belongs in 6.0; this stays
strictly minimal-change for the 5.2.4 patch.

Before 5.2.0 (1.0 through 5.1.2), the second arg was the active
skin name, not a hard-code (see the initial-commit form),
so the per-skin scope was different.

@malberts malberts force-pushed the fix/modal-backdrop-skin-loading branch 3 times, most recently from 74491e5 to 460a7c7 Compare May 21, 2026 22:32
@malberts malberts changed the title Pass active skin name into per-component module lookup Restore loading of vector-fix CSS modules on MW 1.43+ May 22, 2026
@malberts malberts changed the title Restore loading of vector-fix CSS modules on MW 1.43+ Restore loading of vector-fix CSS modules May 22, 2026
@malberts malberts force-pushed the fix/modal-backdrop-skin-loading branch 5 times, most recently from 67a0883 to 4314c3a Compare May 22, 2026 08:38
@malberts malberts changed the title Restore loading of vector-fix CSS modules Restore vector-fix CSS loading and declare jquery on init scripts May 22, 2026
malberts and others added 2 commits May 22, 2026 10:40
`AbstractComponent::augmentParserOutput()` used to load each
component's per-skin module variants by calling `getModulesFor()`
with a hard-coded `'vector'` skin name, which the JSON registry
treats as "always include the vector entry alongside the default".
That published the `modal.vector-fix` and `popover.vector-fix` CSS
to every skin's output, hiding the `.modal-backdrop` element on
Vector-family chromes that would otherwise overlay the page.

MediaWiki 1.43's ParserOutputAccess lifecycle change broke that
publication path: the modules attached via the augment hook no
longer reach the OutputPage. The earlier sparse-loading patch in
`HooksHandler::onParserAfterParse` (5.2.3) routed the default
modules through `ParserAfterParse` instead, but its foreach didn't
pass any skin argument, so the per-skin entries stopped loading
on every skin. Users on Vector, Vector 2022, MonoBook, and Timeless
all end up with the BS4 modal backdrop covering the page once a
modal opens.

Pass the same hard-coded `'vector'` into the post-parse foreach so
the registry returns the per-skin variants exactly as it did
pre-1.43. The redesign of this path (route by active skin name,
audit per-skin requirements) belongs in the next major release.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Per the reviewer comment at
#80 (review)
the test pinned a single argument literal through deep mocks of
every collaborator on `HooksHandler`, coupling to call signatures
rather than behaviour. Integration verification on the running
rig covers the regression more reliably.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@malberts malberts force-pushed the fix/modal-backdrop-skin-loading branch 2 times, most recently from ddc65e4 to c0ac01b Compare May 22, 2026 09:00
@malberts malberts changed the title Restore vector-fix CSS loading and declare jquery on init scripts Restore loading of vector-fix CSS modules May 22, 2026
@malberts malberts marked this pull request as ready for review May 22, 2026 09:13
@malberts malberts merged commit b9cd8be into 5.x May 22, 2026
6 of 7 checks passed
@malberts
Copy link
Copy Markdown
Collaborator Author

malberts commented May 22, 2026

Manually tested with: MW 1.43.8 + Bootstrap extension 5.0.0 [= BS framework 4.6.2] + BC 5.2.3), two BS4 stacks, all six skins.

Skin Pre-fix (BC 5.2.3 vanilla) Post-fix (PR applied)
Vector 2022 Backdrop renders above modal; page unselectable Backdrop suppressed; modal usable
Vector (2011 / legacy) Same as Vector 2022 Same as Vector 2022
MonoBook Same Same
Timeless Same Same
Chameleon 5.x Modal + backdrop render correctly (no bug) Backdrop suppressed; modal still works
Medik 4.x Same as Chameleon Same as Chameleon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant