Skip to content

Allow pages to expand the super sidebar by default

The following discussion from !110868 (merged) should be addressed:

Keep the sidebar expanded by default on certain pages (while the viewport is ≥ 1200px), regardless if a user has previously collapsed the sidebar. The user can still choose to collapse the sidebar while on these pages, though the preference will not be maintained. This exposes important information on these pages that a user may not know exists otherwise.

  • Global Search
  • Profile pages
  • Help page
  • Settings pages

Approach

Attached is a patch ( default-expanded-super-sidebar.patch) for a possible approach which looks to add a property to .html template files which is used to force collapsed_super_sidebar? to be false.

   def collapsed_super_sidebar?
-    cookies["super_sidebar_collapsed"] == "true"
+    if defined?(@default_expanded_super_sidebar) && @default_expanded_super_sidebar
+      false
+    else
+      cookies["super_sidebar_collapsed"] == "true"
+    end
   end

Pages

URL Template
/help /app/views/layouts/help.html.haml
/search /app/views/layouts/search.html.haml
/{username} /app/views/users/show.html.haml
/admin/application_settings/appearance /app/views/admin/application_settings/appearances/show.html.haml
/admin/application_settings/advanced_search ee/app/views/admin/application_settings/advanced_search.html.haml
/admin/application_settings/ci_cd /app/views/admin/application_settings/ci_cd.html.haml
/admin/application_settings/general /app/views/admin/application_settings/general.html.haml
/admin/application_settings/integrations /app/views/admin/application_settings/integrations.html.haml
/admin/application_settings/metrics_and_profiling /app/views/admin/application_settings/metrics_and_profiling.html.haml
/admin/application_settings/network /app/views/admin/application_settings/network.html.haml
/admin/application_settings/preferences /app/views/admin/application_settings/preferences.html.haml
/admin/application_settings/reporting /app/views/admin/application_settings/reporting.html.haml
/admin/application_settings/repository /app/views/admin/application_settings/repository.html.haml
/admin/application_settings/service_usage_data /app/views/admin/application_settings/service_usage_data.html.haml
Edited by Scott de Jonge