+ <%= yield :system_alerts %>
<%= yield %>
<%= settings_nav_footer_mobile %>
diff --git a/app/views/layouts/shared/_htmldoc.html.erb b/app/views/layouts/shared/_htmldoc.html.erb
index 444e053f1..8f8600e21 100644
--- a/app/views/layouts/shared/_htmldoc.html.erb
+++ b/app/views/layouts/shared/_htmldoc.html.erb
@@ -40,19 +40,27 @@
and for managed-mode deployments — `current_sidekiq_health` returns
nil in those cases. %>
<% if Current.user&.super_admin? && current_sidekiq_health && !current_sidekiq_health.healthy? %>
- <%# Stack below any sticky impersonation bars instead of hard-coding
- 80px (`top-20`). Each bar is ~60px tall (`py-4` + content), so
- adjust the fixed offset based on how many are visible. %>
- <% banner_top_class = if super_admin_bar_visible && approval_bar_visible
- "top-36"
- elsif super_admin_bar_visible || approval_bar_visible
- "top-20"
- else
- "top-4"
- end %>
-
- <%= render "shared/sidekiq_health_banner", health: current_sidekiq_health %>
-
+ <% if sidebar_aware %>
+ <% content_for :system_alerts do %>
+
+ <%= render "shared/sidekiq_health_banner", health: current_sidekiq_health %>
+
+ <% end %>
+ <% else %>
+ <%# Stack below any sticky impersonation bars instead of hard-coding
+ 80px (`top-20`). Each bar is ~60px tall (`py-4` + content), so
+ adjust the fixed offset based on how many are visible. %>
+ <% banner_top_class = if super_admin_bar_visible && approval_bar_visible
+ "top-36"
+ elsif super_admin_bar_visible || approval_bar_visible
+ "top-20"
+ else
+ "top-4"
+ end %>
+
+ <%= render "shared/sidekiq_health_banner", health: current_sidekiq_health %>
+
+ <% end %>
<% end %>
<%= yield %>
diff --git a/app/views/shared/_sidekiq_health_banner.html.erb b/app/views/shared/_sidekiq_health_banner.html.erb
index 0c3756f12..9827659f0 100644
--- a/app/views/shared/_sidekiq_health_banner.html.erb
+++ b/app/views/shared/_sidekiq_health_banner.html.erb
@@ -11,6 +11,7 @@
diff --git a/test/system/sidekiq_health_banner_test.rb b/test/system/sidekiq_health_banner_test.rb
new file mode 100644
index 000000000..c1cf7d514
--- /dev/null
+++ b/test/system/sidekiq_health_banner_test.rb
@@ -0,0 +1,26 @@
+require "application_system_test_case"
+
+class SidekiqHealthBannerTest < ApplicationSystemTestCase
+ setup do
+ @health = Object.new
+ @health.stubs(:healthy?).returns(false)
+ @health.stubs(:reason).returns(:queue_backed_up)
+
+ Rails.application.config.stubs(:app_mode).returns("self_hosted".inquiry)
+ Redis.any_instance.stubs(:ping).returns("PONG")
+ SidekiqHealth.stubs(:current).returns(@health)
+ end
+
+ test "dashboard data warning reserves space instead of overlapping the page header" do
+ sign_in users(:sure_support_staff)
+ visit root_path
+
+ assert_selector "[data-testid='sidekiq-health-banner']"
+
+ banner_rect = page.evaluate_script("document.querySelector('[data-testid=\"sidekiq-health-banner\"]').getBoundingClientRect()")
+ heading_rect = page.evaluate_script("document.querySelector('h1').getBoundingClientRect()")
+
+ assert_operator banner_rect["bottom"], :<=, heading_rect["top"],
+ "expected the stale-data warning to finish above the dashboard heading"
+ end
+end