Skip to content

[6.x] Remove architectural lines when leaving a navigation page - #15681

Merged
jaygeorge merged 1 commit into
6.xfrom
15680-architectural-lines-leak
Oct 19, 2026
Merged

jaygeorge merged 1 commit into
6.xfrom
15680-architectural-lines-leak

Conversation

@jaygeorge

@jaygeorge jaygeorge commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Description of the Problem

If you open a navigation with no items and then go somewhere else in the CP, the architectural lines background follows you. For example, it shows up behind the Collections list, and behind the Pages tree.

The navigation page turns the lines on and off from its tree callbacks, which call toggleArchitecturalBackground(). That helper relies on onUnmounted() to clean up, but these calls happen in methods, not in setup, so there's no component for onUnmounted() to attach to. The cleanup never gets registered and the class stays on the content card.

What this PR Does

Adds an unmounted() hook to the navigation page that turns the lines off when you leave.

I've kept the fix in the page rather than changing the helper. The helper can't clean up after a caller it isn't attached to, and making it skip onUnmounted() outside setup would only hide the dev warning that points at this kind of leak. The page is the one turning the lines on, so it should be the one turning them off.

This also means the :not(:has(.page-tree-branch)) guard on bg-architectural-lines isn't needed any more, so #15679 can drop it.

Before / After

image

How to Reproduce

  1. Create a navigation and leave it empty
  2. Open it, so you see the "Start designing your navigation" screen with the lines behind it
  3. Click Collections in the sidebar
  4. The lines are still there behind the list

- The tree callbacks toggle the lines from methods, where toggleArchitecturalBackground's onUnmounted has no component to attach to, so leaving an empty nav left the lines on the next page
@jaygeorge
jaygeorge merged commit 59f5b3e into 6.x Oct 19, 2026
66 checks passed
@jaygeorge
jaygeorge deleted the 15680-architectural-lines-leak branch October 19, 2026 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant