feat(cmdk): Add project search action to command palette#115591
feat(cmdk): Add project search action to command palette#115591JonasBa wants to merge 6 commits into
Conversation
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>
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>
📊 Type Coverage Diff✅ No new type safety issues introduced. Coverage: 93.52% |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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>
| to: `/organizations/${organization.slug}/projects/${project.slug}/`, | ||
| })), | ||
| }); |
There was a problem hiding this comment.
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.

Description
Adds a new command palette (Cmd+K) action that allows users to search for projects and navigate to their pages.
Changes
Projectscmdk action that searches projects as the user types/organizations/:org/projects/:project/when a project is selectedImplementation Details
The implementation:
/organizations/:org/projects/API endpoint with query parameterProjectAvatarfor consistent visual representationUser Feedback
This addresses user feedback requesting the ability to search for projects and navigate to their pages via the command palette:
Testing
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