Page MenuHomePhabricator

Make CollapsibleFieldsetLayout more reusable
Closed, ResolvedPublic

Description

For context, see T269878#6856049.

The CollapsibleFieldsetLayout is a PHP layout that uses the script jquery.makeCollapsible.js (also used by other components), which works with the class mw-collapsible.

The margins and padding for the CollapsibleFieldsetLayout are defined in mediawiki.htmlform.ooui.styles.less, and are applied to elements with the mw-collapisble class (among others) inside an element with class mw-htmlform-ooui-wrapper.

IPInfo uses CollapsibleFieldsetLayout outside of a form, so the margins and padding are inconsistent:

image.png (729×173 px, 6 KB)

Rather than re-implement these styles just for IPInfo's use-case, it would be more helpful to create a new CSS stylesheet for CollapsibleFieldsetLayout that applies these styles. We'd also need to add a CSS class that is specific to the CollapsibleFieldsetLayout. This allows the layout to be reused more flexibly.

Details

Related Changes in Gerrit:

Event Timeline

Change 677895 had a related patch set uploaded (by Wikitrent; author: Wikitrent):

[mediawiki/core@master] WIP: CollapsibleFieldsetLayout more reusable

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

Change 679916 had a related patch set uploaded (by Wikitrent; author: Wikitrent):

[mediawiki/extensions/IPInfo@master] WIP: Update IPInfo to match styling

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

Change 677895 merged by jenkins-bot:

[mediawiki/core@master] Make CollapsibleFieldsetLayout more reusable

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

dom_walden subscribed.

How Special:Contributions looks now:

css_changes.png (1,711×133 px, 3 KB)

Because this change potentially impacts all UI components that use CollapsibleFieldsetLayout, I did some regression testing of:

  • Revision history
  • Source Editor preview
  • Special:Investigate (filters)
  • Special:AbuseLog

Test environment: en.wikipedia.beta.wmflabs.org MediaWiki 1.37.0-alpha (829666c) 06:35, 14 June 2021; IP Info 0.0.0 (aa5dd2b) 06:31, 31 May 2021.