Revert legend when results are grouped
authorpetarpetkovic <ppetkovic@wikimedia.org>
Tue, 6 Feb 2018 22:33:02 +0000 (23:33 +0100)
committerpetarpetkovic <ppetkovic@wikimedia.org>
Tue, 6 Feb 2018 22:33:02 +0000 (23:33 +0100)
Since Ifecaaff572, legend was using position: absolute when results are
grouped by page. Most users found such behavior annoying and unexpected,
so positioning is being reverted to previous state.

Only change besides reverting is preventing collapsed legend to push
away the surrounding results. Without that, we would have scenarios
where legend is expanded and collapsed, but results are pushed away as
if legend is still expanded.

Bug: T182156
Bug: T184165
Change-Id: I5adb7e1cb793ec30fba9d5d9674a7fa294d9a3a5

includes/specialpage/ChangesListSpecialPage.php
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ChangesListWrapperWidget.less
resources/src/mediawiki.special/mediawiki.special.changeslist.css

index 282d764..cf990c2 100644 (file)
@@ -1625,13 +1625,9 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                # Collapsible
                $collapsedState = $this->getRequest()->getCookie( 'changeslist-state' );
                $collapsedClass = $collapsedState === 'collapsed' ? ' mw-collapsed' : '';
-               # Enhanced mode
-               $enhancedMode = $this->getRequest()->getBool( 'enhanced', $user->getOption( 'usenewrc' ) );
-               $enhancedClass = $enhancedMode ? ' mw-enhanced' : '';
 
-               $legendClasses = $collapsedClass . $enhancedClass;
                $legend =
-                       '<div class="mw-changeslist-legend mw-collapsible' . $legendClasses . '">' .
+                       '<div class="mw-changeslist-legend mw-collapsible' . $collapsedClass . '">' .
                                $legendHeading .
                                '<div class="mw-collapsible-content">' . $legend . '</div>' .
                        '</div>';
index c379e27..e9e331b 100644 (file)
                }
        }
 
-       &-enhancedView {
-               .mw-changeslist-legend {
-                       z-index: 1;
-
-                       &:not( .mw-collapsed ) {
-                               .box-shadow( 0 1px 1px rgba( 0, 0, 0, 0.15 ) );
-                       }
-               }
-       }
-
        .mw-changeslist-legend {
                background-color: @background-color-base;
+               position: relative; // We want to keep the legend accessible when results are overlaid
                border: 1px solid @colorGray12;
-
-               &:not( .mw-enhanced ) {
-                       // We want to keep the legend accessible when results are overlaid
-                       position: relative;
-               }
        }
 
        .mw-changeslist-overlay {
index 44adbf3..65860ea 100644 (file)
 }
 
 .mw-changeslist-legend.mw-collapsed {
-       margin: 0;
+       margin-bottom: 0;
 }
 
-/* Prevent pushing down of content if legend is initially collapsed */
-.mw-changeslist-legend.mw-collapsed ~ ul:first-of-type > li:first-child {
+/* Prevent pushing down the content if legend is collapsed */
+.mw-changeslist-legend.mw-collapsed ~ ul:first-of-type > li:first-child,
+.mw-changeslist-legend.mw-collapsed + h4 + div > table.mw-changeslist-line:first-child {
        clear: right;
 }
-
-/* Absolute positioning to avoid table overlap with floating elements */
-.mw-changeslist > .mw-changeslist-legend.mw-enhanced {
-       background-color: #fff;
-       position: absolute;
-       right: 0;
-}