Skip to content

Conversation

@priscilawebdev
Copy link
Member

@priscilawebdev priscilawebdev commented Oct 13, 2025

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

@github-actions github-actions bot added Scope: Frontend Automatically applied to PRs that change frontend components Scope: Backend Automatically applied to PRs that change backend components labels Oct 13, 2025
@github-actions
Copy link
Contributor

🚨 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 #discuss-dev-infra channel.

@codecov
Copy link

codecov bot commented Oct 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

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           

@priscilawebdev priscilawebdev force-pushed the priscila/feat/add-select-dropddown-for-integrations-channels branch from c08b7b0 to 981ee3c Compare October 14, 2025 04:41
…nels' into priscila/feat/add-select-dropddown-for-integrations-channels
@priscilawebdev priscilawebdev removed the Scope: Backend Automatically applied to PRs that change backend components label Oct 14, 2025
cursor[bot]

This comment was marked as outdated.

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
Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member

Choose a reason for hiding this comment

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

The comment is not the problem, the UX is

iirc, react-select exposes props which can be used to edit the prefix for the create options.
No prefix would be best imo.

Screenshot 2025-10-22 at 09 39 59

Copy link
Member Author

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

Copy link
Member

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 "+"?

Copy link
Member Author

@priscilawebdev priscilawebdev Oct 22, 2025

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.

@ArthurKnaus
Copy link
Member

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}>
Copy link
Member

Choose a reason for hiding this comment

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

The form field adds some additional padding on the left.
Image

Copy link
Member Author

Choose a reason for hiding this comment

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

good eyes!

Copy link
Member Author

Choose a reason for hiding this comment

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

it should be good now
image

}),
error:
data?.valid === false
? (data.detail ?? t('Invalid integration channel'))
Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member Author

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

Copy link
Member

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 👍

Copy link
Member Author

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" 😉

@priscilawebdev
Copy link
Member Author

priscilawebdev commented Oct 22, 2025

the layout is jumping for me

Screen.Recording.2025-10-22.at.09.34.28.mov

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 menuPlacement="auto" a non-changing prop.

cursor[bot]

This comment was marked as outdated.

@priscilawebdev priscilawebdev requested review from ArthurKnaus and GabeVillalobos and removed request for ArthurKnaus October 22, 2025 08:49
@priscilawebdev priscilawebdev merged commit c03e335 into master Oct 24, 2025
48 checks passed
@priscilawebdev priscilawebdev deleted the priscila/feat/add-select-dropddown-for-integrations-channels branch October 24, 2025 04:52
priscilawebdev added a commit that referenced this pull request Oct 25, 2025
…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.
priscilawebdev added a commit that referenced this pull request Oct 28, 2025
…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.
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