Skip to content

feat(cmdk): Add project search action to command palette#115591

Open
JonasBa wants to merge 6 commits into
masterfrom
cursor/add-project-search-cmdk-866a
Open

feat(cmdk): Add project search action to command palette#115591
JonasBa wants to merge 6 commits into
masterfrom
cursor/add-project-search-cmdk-866a

Conversation

@JonasBa
Copy link
Copy Markdown
Member

@JonasBa JonasBa commented May 14, 2026

Description

Adds a new command palette (Cmd+K) action that allows users to search for projects and navigate to their pages.

Changes

  • Added a new Projects cmdk action that searches projects as the user types
  • Follows the same pattern as existing member and team search actions
  • Shows project avatars and names in the search results
  • Navigates to /organizations/:org/projects/:project/ when a project is selected

Implementation Details

The implementation:

  • Uses the /organizations/:org/projects/ API endpoint with query parameter
  • Enabled when the user has typed at least 1 character
  • Displays up to 4 results by default
  • Shows project name as details when it differs from the slug
  • Uses ProjectAvatar for consistent visual representation

User Feedback

This addresses user feedback requesting the ability to search for projects and navigate to their pages via the command palette:

Search projects and go to page via cmd+k

Testing

  • ✅ TypeScript compilation - no type errors
  • ✅ Unit tests pass - added test case for project search functionality
  • ✅ All existing command palette tests continue to pass

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Slack Thread

Open in Web Open in Cursor 

Add a new cmdk action that allows users to search for projects.
The action follows the same pattern as member and team search:
- Searches as the user types (enabled when query length >= 1)
- Uses the projects API endpoint
- Displays project avatars and details
- Navigates to the project page (/organizations/:org/projects/:project)

Implements user feedback request for quick project navigation.

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 May 14, 2026
Add test case to verify project search functionality works correctly.
Adds mock response for projects endpoint to ensure all tests pass.

Co-authored-by: Jonas <JonasBa@users.noreply.github.com>
Apply automatic formatting to match project style guidelines.

Co-authored-by: Jonas <JonasBa@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 14, 2026

📊 Type Coverage Diff

✅ No new type safety issues introduced. Coverage: 93.52%

@JonasBa JonasBa marked this pull request as ready for review May 14, 2026 22:05
@JonasBa JonasBa requested a review from a team as a code owner May 14, 2026 22:05
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 75c328c. Configure here.

Remove keywords from the new Projects search action to avoid confusion
with the existing 'Open Project' action. The action will still be
discoverable through its 'Projects' label and individual project results
have their own keywords.

Co-authored-by: Jonas <JonasBa@users.noreply.github.com>
Co-authored-by: Jonas <JonasBa@users.noreply.github.com>
Comment on lines +920 to +922
to: `/organizations/${organization.slug}/projects/${project.slug}/`,
})),
});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The hardcoded navigation URL for projects ignores the insights-to-dashboards-ui-rollout feature flag, causing unnecessary client-side redirects for some users.
Severity: MEDIUM

Suggested Fix

Replace the hardcoded URL string with a call to the makeProjectsPathname() helper function. This will ensure the generated URL correctly accounts for the insights-to-dashboards-ui-rollout feature flag and directs users to the appropriate project page without a redirect.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location:
static/app/components/commandPalette/ui/commandPaletteGlobalActions.tsx#L920-L922

Potential issue: The new `Projects` command palette action hardcodes the navigation URL
to `/organizations/${organization.slug}/projects/${project.slug}/`. However, the correct
project URL is conditional based on the `insights-to-dashboards-ui-rollout` feature
flag. For users without this flag, the correct path is `/insights/projects/`. This
discrepancy forces a client-side redirect and triggers a `Sentry.logger.warn` for an
'Unexpected navigation redirect', a pattern the team is actively working to eliminate.
The `makeProjectsPathname()` helper should be used to generate the correct, conditional
URL.

Did we get this right? 👍 / 👎 to inform future reviews.

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