mirror of
https://github.com/discourse/discourse.git
synced 2026-08-04 10:39:43 +08:00
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. |
||
|---|---|---|
| .. | ||
| page_objects/components | ||
| .gitkeep | ||
| composer_peek_spec.rb | ||
| core_features_spec.rb | ||
| horizon_high_level_spec.rb | ||
| sidebar_topic_button_spec.rb | ||
| user_color_palette_selector_spec.rb | ||