0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-04 10:39:43 +08:00
discourse/themes/horizon/javascripts
Sérgio Saquetim 161a4716ff
FIX: Hide Horizon's new topic button when another panel owns the sidebar (#42069)
Horizon renders its new topic button into the `before-sidebar-sections`
outlet, which
is rendered for whatever panel is current. The button is panel-agnostic
by
construction, and the only thing keeping it off the admin sidebar was a
string
comparison against the current URL.

Any other panel that claims the sidebar slips past that check, and none
of them have a
URL prefix worth matching. `isForcingSidebar` looks like the shared
signal but is not
one: a panel can swap the current panel without setting it.
`showMainPanel` is what
every takeover has in common.

This is latent on main today rather than a visible regression, because
the other
in-repo takeovers claim the panel while the sidebar is disabled anyway.
It stops being
latent with #42058, which moves the styleguide navigation into a sidebar
panel: the
sidebar stays enabled there, the path is not `/admin`, and the forum's
new topic
button renders on top of the styleguide's own navigation.

Admin behavior is unchanged. `AdminRoute#activate` calls
`maybeForceAdminSidebar` with
`onlyIfAlreadyActive: false`, so the panel is forced unconditionally on
every admin
route despite the method name.

### Tests

A rendering test asserts both directions on an ordinary forum URL:
rendered while the
forum panel owns the sidebar, hidden while another panel does. Reverting
the component
leaves it rendered in the second case.
2026-07-27 17:30:29 -03:00
..
discourse FIX: Hide Horizon's new topic button when another panel owns the sidebar (#42069) 2026-07-27 17:30:29 -03:00
.gitkeep FIX: import Horizon system theme (#33229) 2025-06-17 14:03:38 +08:00