Scope + menu dropdown to current organization

What does this MR do and why?

Related to #608081 and !253291 (merged).

When a user has adopted organizations, the + (Create new…) top-bar menu now scopes its create links to the relevant organization:

  • General section — scopes to the request's organization (resolved from the /o/:organization_path segment or the group/project in the URL, including legacy global routes) and is titled In this organization instead of In GitLab. Links point to the organization-scoped pages (/o/:organization_path/...).
  • Group section — scopes the New project/repository and New subgroup links to the group's own organization, so they create within it even when the group is reached via a legacy global route.

"Adopted organizations" is determined by Organizations::Release.enrolled?(current_user). The default organization is never URL-scoped (scoped_paths? is false), so its links stay global and the section keeps the In GitLab title.

The change is gated behind the organization_scoped_new_dropdown gitlab_com_derisk feature flag (see Feature flag section below).

Feature flag

This change is behind the organization_scoped_new_dropdown feature flag (type gitlab_com_derisk, default disabled) out of an abundance of caution. Should be low-risk change but we're putting Organizations::Release.enrolled? in a high-volume critical request path.

When "In this organization" appears

Assumes the organization_scoped_new_dropdown feature flag is enabled; when it is disabled the menu is always global (In GitLab).

Scenario Section title Link scope
SaaS (.com) — user enrolled (has a non-default active organization), viewing a scoped (non-default) organization or one of its groups/projects — including via a legacy global URL In this organization Org-scoped (/o/:organization_path/...)
SaaS (.com) — user enrolled, but the resolved organization is the default (unscoped) organization In GitLab Global
SaaS (.com) — user not enrolled (no non-default active organization) In GitLab Global
Self-managed / Dedicated — no enrollment flag passed, so Organizations::Release.enrolled? is always false In GitLab Global

Notes:

  • "Enrolled" is Organizations::Release.enrolled?(current_user). On .com this is true when the user has a non-default active organization; on self-managed it requires an enrollment flag (none is passed here), so it is always false.
  • The default organization is never URL-scoped (scoped_paths? is false), so even for enrolled users its links stay global.
  • The group section scopes to the group's own organization; the general section scopes to the request's organization (resolved from the /o/:path segment or the group/project in the URL).

Screenshots or screen recordings

Notice the URL rendered in the bottom left corner of each screenshot, as well as which menu sections appear.

Note: Since these screenshots were posted, new organization and new snippet no longer appear in the "In this organization" menu.

Before After
Screenshot 2026-09-16 at 1.31.24 PM.png Screenshot 2026-09-16 at 1.22.14 PM.png
Screenshot 2026-09-16 at 1.30.47 PM.png Screenshot 2026-09-16 at 1.16.46 PM.png
Screenshot 2026-09-16 at 1.30.52 PM.png Screenshot 2026-09-16 at 1.16.53 PM.png

How to set up and validate locally

  1. Go to /rails/features and enable the org_stage_experimental, org_stage_beta, and organization_scoped_new_dropdown feature flags.
  2. Go to /o/new and create an organization.
  3. Open the + menu — the general section should be titled In this organization and its links should be org-scoped.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist.

Edited by Drew Blessing

Merge request reports

Loading
Loading