Skip to content

Fix #55: lock group collapse while customize mode is active#66

Merged
chriskmnds merged 1 commit into
trunkfrom
lucasmdo/lock-group-collapse-55
May 22, 2026
Merged

Fix #55: lock group collapse while customize mode is active#66
chriskmnds merged 1 commit into
trunkfrom
lucasmdo/lock-group-collapse-55

Conversation

@lucasmendes-design
Copy link
Copy Markdown
Collaborator

Summary

Users could collapse the My Plugins group via its chevron mid-reorder, stranding the customize session with no items visible — surfaced during May 2026 usability testing.

This PR adopts the first option the issue proposes ("stay expanded, chevron disabled"):

  • The group toggle <button> carries the native :disabled state for the duration of the customize session — blocks both mouse and keyboard activation.
  • The chevron <span> forwards its click via toggle.click(), which is a no-op against a disabled button, so it's neutralised for free.
  • A marker class (wp-admin-sidebar-group--reorder-locked) on the locked group drives a cursor: not-allowed + dimmed-opacity rule on the chevron so the affordance reads as inactive.

Closes #55.

Implementation

All changes piggyback on expandGroupsForCustomizing() — the existing function that force-expands reassignable groups on enter and pairs entry-decoration with a restorer. Lock + visual marker are applied alongside the force-expand; the restorer re-enables the toggle before running the existing click-to-restore logic (otherwise the click would be swallowed and the group would be stranded in its forced state).

CSS lives in customizer.css next to the other customize-mode-scoped rules. Opacity dim matches the existing .wp-admin-sidebar-group__customize:disabled treatment.

No behaviour change outside customize mode.

Test plan

  • Enter customize mode → My Plugins group expands (existing behaviour preserved).
  • Hover the chevron → cursor shows not-allowed, chevron opacity drops to ~0.4.
  • Click the chevron → nothing happens; group stays expanded.
  • Click the "MY PLUGINS" label area (toggle button) → nothing happens.
  • Tab to the group header → the disabled toggle is skipped in tab order; pressing Enter/Space anywhere on it does nothing.
  • Click Save → customize mode exits; toggle and chevron return to normal interactivity; pre-customize expand state is restored.
  • Click Cancel (with or without unsaved changes) → same as Save: full restoration.
  • Refresh mid-customize (beforeunload prompt accepted) → toggle returns to enabled on the next paint (regression check; the disabled state shouldn't survive a reload).

🤖 Generated with Claude Code

Users could collapse the My Plugins group via its chevron mid-reorder,
stranding the customize session with no items visible — surfaced during
May 2026 usability testing.

Disable the group toggle <button> on enterCustomizer and re-enable it
on exit. The chevron <span> forwards clicks via `toggle.click()`, which
is a no-op on a disabled button, so it's neutralised for free. A marker
class on the locked group drives a `cursor: not-allowed` + dimmed
opacity rule on the chevron for a visible affordance cue.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@chriskmnds chriskmnds added the pending: Calypso-parity Not yet implemented on the Calypso side. label May 16, 2026
@chriskmnds chriskmnds merged commit 316d455 into trunk May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending: Calypso-parity Not yet implemented on the Calypso side.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plugin menu can be collapsed while reorder mode is active

2 participants