Skip to content

Conversation

evanpurkhiser
Copy link
Member

@evanpurkhiser evanpurkhiser commented Aug 20, 2025

  • Replaces the deprecated dropdownAutoComplete with a CompactSelect

  • Removes the complex logic to have a with a much
    simpler interface that uses a familiar drop-down to select the
    integration to use a token from.

See example here https://sentry-kajlvytky.sentry.dev/explore/releases/?project=4503972821204992

@evanpurkhiser evanpurkhiser requested a review from a team as a code owner August 20, 2025 17:23
@evanpurkhiser evanpurkhiser requested review from a team and removed request for a team August 20, 2025 17:23
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Aug 20, 2025
Copy link
Member

@gggritso gggritso left a comment

Choose a reason for hiding this comment

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

The code LGTM but the behaviour seems weird:

  1. I can see the "Token From" dropdown on the preview deploy, but I don't see anything like that in production on my user. Is the permission check bugged?
  2. When I change the token in the dropdown, it doesn't update the code snippet

@evanpurkhiser
Copy link
Member Author

Believe it or not, this is actually the same behavior in prod right now --

It's hard to notice, but there's a <click here for your token> "button"

image

Clicking that gives you a integration selection. Clicking an item in this list actually creates a new token for this integration (it ALWAYS does this). If you don't have permission however it won't be able to do this, so nothing happens, just like in this new version.

The behavior here actually hasn't changed

@evanpurkhiser
Copy link
Member Author

I'd like to merge this as is, so we can unblock the removal of DropdownAutoComplete, at some point we should follow up on this

The right behavior is probably to make an API query to get the list of tokens for the selected integration, and if there's no tokens we can give a warning to the user that they don't have permission to create a token for the selected app.

@evanpurkhiser evanpurkhiser requested a review from gggritso August 25, 2025 16:30
@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/ref-releases-rebuild-releasespromo branch from 66a956b to ac3b3b9 Compare August 25, 2025 16:56
- Replaces the deprecated dropdownAutoComplete with a CompactSelect

- Removes the complex logic to have a <click here for token> with a much
  simpler interface that uses a familiar drop-down to select the
  integration to use a token from.
@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/ref-releases-rebuild-releasespromo branch from ac3b3b9 to dad0741 Compare August 25, 2025 16:59
@evanpurkhiser evanpurkhiser enabled auto-merge (squash) August 25, 2025 17:00
triggerLabel={selectedApp ? undefined : t('Select Integration')}
triggerProps={{prefix: selectedApp ? t('Token From') : undefined}}
onChange={option => {
const app = apps.find(i => i.slug === option.value)!;
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Unsafe Non-Null Assertion in onChange Handler

The non-null assertion operator (!) on apps.find() in the CompactSelect's onChange handler can lead to a runtime error. If the selected option's value doesn't match an existing app (e.g., due to race conditions or data inconsistencies), apps.find() returns undefined, causing a crash.

Fix in Cursor Fix in Web

@evanpurkhiser evanpurkhiser merged commit 2b69de5 into master Aug 25, 2025
45 checks passed
@evanpurkhiser evanpurkhiser deleted the evanpurkhiser/ref-releases-rebuild-releasespromo branch August 25, 2025 17:10
andrewshie-sentry pushed a commit that referenced this pull request Aug 26, 2025
- Replaces the deprecated dropdownAutoComplete with a CompactSelect

- Removes the complex logic to have a <click here for token> with a much
  simpler interface that uses a familiar drop-down to select the
  integration to use a token from.

See example here
https://sentry-kajlvytky.sentry.dev/explore/releases/?project=4503972821204992
constantinius pushed a commit that referenced this pull request Sep 1, 2025
- Replaces the deprecated dropdownAutoComplete with a CompactSelect

- Removes the complex logic to have a <click here for token> with a much
  simpler interface that uses a familiar drop-down to select the
  integration to use a token from.

See example here
https://sentry-kajlvytky.sentry.dev/explore/releases/?project=4503972821204992
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.

3 participants