Problem/Motivation

#3628842: Settings sidebar: keep it open, close it on request only (which was merged without review 😔) has introduced a bug: each Undo/Redo step is opening the contextual panels

Steps to reproduce

  1. Use Display Builder, do some stuff to get a revision log
  2. Close the ContextualPanel sidebar
  3. Click "Undo" button
  4. The contextual panel is opening again

This maddening because it forces us to manually close the sidebar in between each revisions when we want to visualize the changes in history.

Proposed resolution

2 possible ways:

CommentFileSizeAuthor
#5 3633002 after.mov14.46 MBcsakiistvan
#5 3633002 before.mov23.83 MBcsakiistvan
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

pdureau created an issue. See original summary.

pdureau’s picture

Assigned: pdureau » Unassigned
Status: Active » Needs review
csakiistvan’s picture

Assigned: Unassigned » csakiistvan
csakiistvan’s picture

Assigned: csakiistvan » Unassigned
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new23.83 MB
new14.46 MB

✅ Tested and works — before the fix, Undo reopened a closed settings sidebar; after applying MR !512 and rebuilding caches, Undo and Redo in a page layout builder leave the closed sidebar closed, and it still opens manually on request. The history steps no longer force the sidebar open.

Notes
  • Non-blocking, from reading the test: data-trigger-node-id is already set before the redo, and htmxReady() may resolve before the refresh click fires, so the new step may pass without the fix; waiting for a refresh signal (e.g. the Label value) before asserting is-collapsed would make it fail reliably.
  • Non-blocking: data-refresh-node-id is only cleared in the click branch of handleSecondDrawer(); passing the refresh intent explicitly (e.g. a 'refresh' type, as triggerSingleClick() in panel_tree.js does) would avoid a leftover flag.
pdureau’s picture

Thanks you so much.

If you want to propose the 2 non-blocking changes, and if you believe it will be a small and safe change, you can assign the ticket to you and add a commit to the MR.

csakiistvan’s picture

Assigned: Unassigned » csakiistvan
csakiistvan’s picture

Assigned: csakiistvan » Unassigned

@pdureau Pushed both non-blocking changes: the history refresh now passes its intent on the click event instead of a DOM flag, and the test waits for the refresh request before asserting the drawer stays collapsed (it fails without the fix). Pipeline is green.

pdureau’s picture

Assigned: Unassigned » mogtofu33

Thanks a lot

  • mogtofu33 committed 97011d37 on 1.0.x authored by pdureau
    fix: #3633002 Undo/Redo is opening the contextual panels
    
    By: pdureau
    By...
mogtofu33’s picture

Assigned: mogtofu33 » Unassigned
Status: Reviewed & tested by the community » Fixed

To be more precise the bug is only when using the close cross, not the toolbar button for the sidebar.

Thanks for the MR.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

pdureau’s picture

Status: Fixed » Closed (fixed)

Shipped in beta10 release.