Skip to content

Add NoOrganizationDropdown component for users with no organization#112475

Draft
JonasBa wants to merge 5 commits intomasterfrom
cursor/add-no-org-dropdown-0971
Draft

Add NoOrganizationDropdown component for users with no organization#112475
JonasBa wants to merge 5 commits intomasterfrom
cursor/add-no-org-dropdown-0971

Conversation

@JonasBa
Copy link
Copy Markdown
Member

@JonasBa JonasBa commented Apr 8, 2026

Summary

This PR adds a new NoOrganizationDropdown component that displays when a user has no organization context. The component provides a consistent navigation experience by:

  • Rendering an AvatarButton with the Sentry logo as the background
  • Including a "Create a new organization" link in the dropdown menu
  • Adopting the same layout structure as the regular primary navigation (organization dropdown at top, user settings at bottom)

Changes

New Components

  • NoOrganizationDropdown: A dropdown component that renders when there's no organization in context
    • Uses AvatarButton with Sentry logo
    • Includes "Create a new organization" link
    • Respects organizations:create feature flag
    • Handles both multi-region and single-region configurations

Updated Components

  • UserOnlyNavigation: Updated to use the same layout structure as the regular primary navigation
    • Organization dropdown (now NoOrganizationDropdown) at the top in SidebarHeader
    • User settings at the bottom in FooterItems
    • Properly wrapped with SizeProvider for consistent sizing

Tests

  • Added comprehensive test coverage for NoOrganizationDropdown
    • Tests dropdown rendering
    • Tests create organization link visibility based on feature flags
    • Tests multi-region vs single-region URL handling

Related Context

From Slack discussion in #discuss-design-engineering:

Jonas: "You know what, I think cursor can just add a default org button with a create org link inside it."

This implements that suggestion by providing a clean, consistent navigation experience for users without an organization.

Testing

All linting checks pass. The component follows Sentry's design system guidelines and uses core components throughout.

Slack Thread

Open in Web Open in Cursor 

- Create new NoOrganizationDropdown component that renders when user has no org
- Use AvatarButton with Sentry logo as background
- Include 'Create a new organization' link in dropdown menu
- Update UserOnlyNavigation to use same layout as regular primary nav
- Add organization dropdown at top and user settings at bottom
- Add comprehensive test coverage for the new component

Co-authored-by: Jonas <JonasBa@users.noreply.github.com>
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 8, 2026
Add organizationUrl and regionUrl to links object in ConfigFixture
to match the required type signature.

Co-authored-by: Jonas <JonasBa@users.noreply.github.com>
The imported SVG logo was causing runtime errors because webpack loaders
return an object, not a string URL. Using letter_avatar with 'Sentry'
identifier provides a clean, working solution that displays 'S' as the avatar.

Co-authored-by: Jonas <JonasBa@users.noreply.github.com>
Instead of using hidden property which causes empty menus,
conditionally build the items array based on feature flags.

Co-authored-by: Jonas <JonasBa@users.noreply.github.com>
DropdownMenu renders items with menuitemradio role, not menuitem.

Co-authored-by: Jonas <JonasBa@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants