Skip to content

Commit c5d5311

Browse files
authored
Merge pull request #70 from dknauss/fix/edit-mode-separator-band
fix(editor): collapse menu separators in edit mode (BUG-09 separator band)
2 parents 735cd79 + d27ac50 commit c5d5311

3 files changed

Lines changed: 41 additions & 0 deletions

File tree

assets/maestro.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,22 @@ body.maestro-editing #collapse-menu {
4646
display: none !important;
4747
}
4848

49+
/* Core menu separators (a ~11px-tall li.wp-menu-separator + inner div.separator)
50+
* read as a stray dark band between groups while editing — most visibly above
51+
* the Posts group — because the force-expanded submenus already cluster each
52+
* group, so the gap looks like extra dead space enlarging the next item.
53+
* Collapse separators in edit mode (li AND the inner div). Separators are not
54+
* editable in v1, so nothing is lost; !important beats WP core's per-version
55+
* separator sizing across admin colour schemes. */
56+
.maestro-editing #adminmenu li.wp-menu-separator,
57+
.maestro-editing #adminmenu li.wp-menu-separator .separator {
58+
height: 0 !important;
59+
min-height: 0 !important;
60+
margin: 0 !important;
61+
padding: 0 !important;
62+
border: 0 !important;
63+
}
64+
4965
/* ---------- accessibility utilities ------------------------------------- */
5066

5167
/* Canonical WordPress .screen-reader-text implementation (clip-path variant).

readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ If Maestro saves you time or brings you or your clients the joy of a tidy admin
129129
* Saved overrides now keep applying even when your site moves to a new host, when a plugin updates and changes a version number in its menu URL, when UTM tracking parameters drift on external-tool links, and when a taxonomy slug is stored with `&` encoding instead of `&` (or vice versa) — no manual re-save needed.
130130
* Edit-mode toolbar: the Exit and Reset All controls now use clearer, more consistent icons (Exit matches the admin-bar toggle).
131131
* Fix: the one-time first-run highlight on the first menu item is now reliably momentary — it no longer stays outlined for people who use the "reduce motion" accessibility setting.
132+
* Fix: while editing, the menu's group separators no longer show as a stray dark band between sections (most noticeable above the Posts group); they collapse so items sit flush. The normal menu is unchanged.
132133

133134
= 1.2.0 =
134135
* Redesigned edit-mode toolbar: every control is now a compact icon button in one consistent system, with colour signalling meaning — green for editing/saved, amber for unsaved changes, red for Reset All. Fully accessible: each control keeps its name for screen readers and shows a tooltip on hover.

tests/e2e/separators.spec.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { test, expect } from '@playwright/test';
2+
3+
/**
4+
* Regression: WP core menu separators (li.wp-menu-separator + inner div.separator)
5+
* must collapse to zero height in edit mode. With submenus force-expanded, the
6+
* default ~11px separator gap reads as a stray dark band between groups (most
7+
* visibly above the Posts group), making the next item look enlarged. They are
8+
* not editable in v1, so they are collapsed while editing.
9+
*/
10+
test( 'menu separators collapse to zero height in edit mode', async ( { page } ) => {
11+
await page.goto( '/wp-admin/index.php?maestro_edit=1', { waitUntil: 'networkidle' } );
12+
await page.waitForSelector( '#adminmenu li.maestro-item' );
13+
14+
const heights = await page.evaluate( () =>
15+
Array.from( document.querySelectorAll( '#adminmenu li.wp-menu-separator' ) ).map(
16+
( li ) => Math.round( ( li as HTMLElement ).getBoundingClientRect().height )
17+
)
18+
);
19+
20+
expect( heights.length ).toBeGreaterThan( 0 ); // separators exist to test
21+
for ( const h of heights ) {
22+
expect( h ).toBe( 0 );
23+
}
24+
} );

0 commit comments

Comments
 (0)