0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-04 10:39:43 +08:00
discourse/themes/horizon/spec/system
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
..
page_objects/components
.gitkeep
composer_peek_spec.rb DEV: Update rubocop (#38721) 2026-03-20 00:39:52 +01:00
core_features_spec.rb DEV: Update rubocop (#38721) 2026-03-20 00:39:52 +01:00
horizon_high_level_spec.rb FEATURE: Enable high context topic cards in Horizon by default (#39959) 2026-05-15 10:50:42 +10:00
sidebar_topic_button_spec.rb FIX: Hide Horizon's new topic button when another panel owns the sidebar (#42069) 2026-07-27 17:30:29 -03:00
user_color_palette_selector_spec.rb DEV: Update rubocop (#38721) 2026-03-20 00:39:52 +01:00