Skip to content

feat(cmd-k): Add DSN lookup to both command palettes#108401

Open
sergical wants to merge 3 commits intomasterfrom
sergical/cmd-k-dsn-lookup-frontend
Open

feat(cmd-k): Add DSN lookup to both command palettes#108401
sergical wants to merge 3 commits intomasterfrom
sergical/cmd-k-dsn-lookup-frontend

Conversation

@sergical
Copy link
Member

@sergical sergical commented Feb 17, 2026

CleanShot 2026-02-17 at 17 23 35

Summary

  • Adds DSN lookup to the new supercharged command palette (useDsnLookupActions hook)
  • Adds DSN lookup to the legacy search modal (dsnLookupSource)
  • Users can paste a DSN and quickly navigate to the corresponding project

Dependencies

Context

Split from #108396 — this is the frontend half.

Test plan

  • Frontend tests pass (CI=true pnpm test useDsnLookupActions)
  • CI passes
  • Manual QA after backend PR lands

Add DSN lookup functionality to both the new supercharged command
palette and the legacy search modal. Users can paste a DSN and get
quick navigation to the corresponding project.

Depends on backend PR #108400.
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Feb 17, 2026
…ared code

- Use correct org-scoped API URL `/organizations/{slug}/dsn-lookup/`
- Reset `isLoading` to false in early-return branch to prevent stuck loading state
- Extract shared `DSN_PATTERN` and `DsnLookupResponse` to `dsnLookupUtils.ts`
Copy link
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.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

import useOrganization from 'sentry/utils/useOrganization';

export function useDsnLookupActions(query: string): CommandPaletteActionWithKey[] {
const organization = useOrganization();
Copy link
Contributor

Choose a reason for hiding this comment

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

useDsnLookupActions crashes when organization context is null

High Severity

content.tsx calls useOrganization({allowNull: true}) and defensively null-checks with optional chaining, indicating the organization context can be null. However, useDsnLookupActions is always invoked (hooks can't be conditional), and it internally calls useOrganization() without allowNull, which throws when the organization context is missing. The empty-string guard (hasDsnLookup ? query : '') doesn't prevent the crash because the hook body still runs useOrganization() before checking the query.

Additional Locations (1)

Fix in Cursor Fix in Web

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.

1 participant