-
-
Couldn't load subscription status.
- Fork 4.5k
feat(project-creation): Replace input text with select to list integration channels #101403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(project-creation): Replace input text with select to list integration channels #101403
Conversation
|
🚨 Warning: This pull request contains Frontend and Backend changes! It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently. Have questions? Please ask in the |
…egration-channels
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #101403 +/- ##
========================================
Coverage 80.97% 80.97%
========================================
Files 8721 8721
Lines 387806 387798 -8
Branches 24544 24544
========================================
- Hits 314038 314033 -5
+ Misses 73420 73417 -3
Partials 348 348 |
c08b7b0 to
981ee3c
Compare
…nels' into priscila/feat/add-select-dropddown-for-integrations-channels
…egration-channels
…nels' into priscila/feat/add-select-dropddown-for-integrations-channels
| clearable | ||
| // The Slack API returns the maximum of channels, and users might not find the channel they want in the first 1000. | ||
| // This allows them to add a channel that is not present in the results. | ||
| creatable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This gives me the impression that I can create a slack channel, which is not possible, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its not possible, but the user can manually type a channel. I will update the comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe "Use" ? because the "+" indicates "Add" too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't we remove the "+"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the core component is enforcing the '+'. I hacked something for this use case, but imo we should leave it there or update the core component.
|
the layout is jumping for me Screen.Recording.2025-10-22.at.09.34.28.mov |
| setChannel(e.target.value) | ||
| } | ||
| /> | ||
| <FormField name="channel" error={validateChannel.error}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good eyes!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| }), | ||
| error: | ||
| data?.valid === false | ||
| ? (data.detail ?? t('Invalid integration channel')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does invalid mean? Does it mean that the channel does not exist or that I don't have permissions? We should clarify that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good observation. In Slack, for example, the response intentionally uses the same error code (channel_not_found) in both cases as a privacy/security measure...they don’t want to reveal whether a private channel exists that a user cannot access.
In contrast, MSTeams simply returns None, so we can’t determine the difference.
Discord is the only platform that exposes this distinction.
Our API currently doesn’t indicate if an error was due to permissions. Should we add that in a follow-up, or is it overkill?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Saying "Invalid" is very abstract and I would still go with that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would mention that it could be due to those two cases (permissions, non-existence).
But that is not blocking the PR 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the error to be "Channel not found or restricted" 😉
Oh, I thought we had solved this in the PR , but since this is Creatable, the issue isn’t completely resolved. I’ll add a prop now, and follow up to make |
…ts (#102067) Recently, we decided to introduce the prop menuPlacement="auto" as the default behavior for ReactSelect ([see](#100658)). However, I noticed through the [PR](#101403 (comment)) that this default was not being applied when the component was a CreatableSelect. This PR fixes that issue, making `menuPlacement="auto"` the default for all select components.
…ts (#102067) Recently, we decided to introduce the prop menuPlacement="auto" as the default behavior for ReactSelect ([see](#100658)). However, I noticed through the [PR](#101403 (comment)) that this default was not being applied when the component was a CreatableSelect. This PR fixes that issue, making `menuPlacement="auto"` the default for all select components.



Problem
When creating a project and configuring notifications to send to Slack, Microsoft Teams, or Discord channels, users currently have to manually enter the channel name.
If the entered channel does not exist, project creation fails (and this is happening quite often see)
This design was originally chosen because:
Some organizations have over 1,000 channels, and
Slack’s API limits the conversations.list endpoint to a maximum of 1,000 results and does not support server-side search.
As a result, even if channels matching a prefix (e.g., discord-) exist, they may not appear in the retrieved set. This means users can type a valid channel name that is simply missing from the truncated API response, leading to failed validation and a poor user experience.
Solution
Since Slack’s API limitations remain and a search api is only available for enterprise users, we can improve our UX with the following approach:
Display up to the 1,000 channels returned by Slack’s API. Users can still manually type a channel name. If the typed channel is not in the list, by selecting it we send an API request to validate the channel, if the channel doesn't exist we display an error message.
Preview
Screen.Recording.2025-10-21.at.06.54.27.mov
closes https://linear.app/getsentry/issue/TET-1229/implement-dropdown-or-validation-for-slack-field