The infobox accordion is generated and output via php in InfoboxHandler.php:
$panelLayout = new PanelLayout( [ 'classes' => [ 'ext-ipinfo-panel-layout' ], 'framed' => true, 'expanded' => false, 'padded' => true, 'content' => ( new CollapsibleFieldsetLayout( [ 'label' => $out->getContext()->msg( 'ipinfo-infobox-title' ), 'collapsed' => true, 'classes' => [ 'ext-ipinfo-collapsible-layout' ], 'infusable' => true, ] ) ), ] ); OutputPage::setupOOUI(); $out->addHTML( $panelLayout );
And the content is appended in infoBox/init.js:
$( '.ext-ipinfo-collapsible-layout .mw-collapsible-content' ).append( ipPanelWidget.$element );
However, init.js can return early:
( function () { var ip = mw.config.get( 'wgIPInfoTarget' ), revId, ipPanelWidget; if ( !ip ) { return; } revId = $( '.mw-contributions-list [data-mw-revid]' ).first().attr( 'data-mw-revid' ); if ( !revId ) { return; }
Which means that the accordion will have been loaded without the content and no indication that content was intentionally not loaded.
We should decide if this is a bug or a feature 😅 and how we want to fix it. Possible solutions are:
- Add an error message
- Remove the accordion using js if we're early returning
- Generate the accordion in js as well*
*this has the benefit of working for no-js cases as well.
AC:
- When the IP Info box loads without content, add this error message:
IP Information for this address cannot be retrieved since it hasn't made any edits on this wiki.
- Error state design from figma: