Skip to content

A platform for community discussion. Free, open, simple.

FIX: Keep sidebar action menus above the mobile sidebar (#45501)

Bryce Huhtala110767678bb7
diff --git a/app/assets/stylesheets/common/base/sidebar-section.scss b/app/assets/stylesheets/common/base/sidebar-section.scss
index 1884c11843f..24422c660ff 100644
--- a/app/assets/stylesheets/common/base/sidebar-section.scss
+++ b/app/assets/stylesheets/common/base/sidebar-section.scss
@@ -196,6 +196,10 @@
inset-block-start: 0;
}
+.fk-d-menu.sidebar-section-header-dropdown-menu-content {
+ z-index: z("header") + 1;
+}
+
.sidebar-section-header-global-indicator__content {
.d-icon-shield-halved {
padding-right: var(--space-1);
diff --git a/spec/system/page_objects/components/sidebar_header_dropdown.rb b/spec/system/page_objects/components/sidebar_header_dropdown.rb
index 2bd69da20da..7f8e1970eca 100644
--- a/spec/system/page_objects/components/sidebar_header_dropdown.rb
+++ b/spec/system/page_objects/components/sidebar_header_dropdown.rb
@@ -31,6 +31,13 @@ module PageObjects
find(".sidebar-section-link[data-link-name='everything']").click
end
+ def click_edit_categories_dropdown_option
+ find("[data-section-name='categories'] .sidebar-section-header-dropdown").click
+ find(
+ ".sidebar-section-header-dropdown-menu-content [data-menu-option-id='edit-categories']",
+ ).click
+ end
+
def click_outside
width = page.evaluate_script("document.body.clientWidth")
page.find("body").click(x: width - 1, y: 1)
diff --git a/spec/system/viewing_sidebar_mobile_spec.rb b/spec/system/viewing_sidebar_mobile_spec.rb
index c5b73bc57a5..ff1e2c90c85 100644
--- a/spec/system/viewing_sidebar_mobile_spec.rb
+++ b/spec/system/viewing_sidebar_mobile_spec.rb
@@ -4,6 +4,7 @@ describe "Viewing sidebar mobile", mobile: true do
fab!(:user)
let(:sidebar_dropdown) { PageObjects::Components::SidebarHeaderDropdown.new }
let(:composer) { PageObjects::Components::Composer.new }
+ let(:edit_categories_modal) { PageObjects::Modals::SidebarEditCategories.new }
before { sign_in(user) }
@@ -34,6 +35,19 @@ describe "Viewing sidebar mobile", mobile: true do
expect(sidebar_dropdown).to be_hidden
end
+ it "lets an admin edit categories from the sidebar action menu" do
+ user.update!(admin: true)
+ visit("/latest")
+
+ sidebar_dropdown.click
+ sidebar_dropdown.click_edit_categories_dropdown_option
+
+ expect(sidebar_dropdown).to be_hidden
+ expect(edit_categories_modal).to have_right_title(
+ I18n.t("js.sidebar.categories_form_modal.title"),
+ )
+ end
+
it "collapses the sidebar when clicking on a link in the sidebar" do
visit("/latest")