Skip to content

Conversation

@aldenquimby
Copy link

I know you cannot accept PRs from External Contributions.

I just filed a support ticket for this, and am creating a PR to show how I think it could be addressed

Here is what things look like before the PR:
image

And after:
image

The idea is that for AI Chatbot generated channels, we should display the name of the chatbot, rather than the default generated AI Chatbot Widget Channel. And only display the channel name if someone as modified it to something custom

@netlify
Copy link

netlify bot commented Dec 5, 2024

‼️ Deploy request for sendbird-uikit-react rejected.

Name Link
🔨 Latest commit d446788

return stringSet.NO_TITLE;
}
if (channel?.name && channel.name !== 'Group Channel') {
if (channel?.name && channel.name !== 'Group Channel' && channel.name !== 'AI Chatbot Widget Channel') {
Copy link
Author

Choose a reason for hiding this comment

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

Here is the primary fix. The rest of the PR is getting all consumers to use a single getChannelTitle helper function

<PlaceHolder
type={PlaceHolderTypes.SEARCH_IN}
searchInString={getChannelName()}
searchInString={getChannelTitle(currentChannel, '', stringSet)}
Copy link
Author

Choose a reason for hiding this comment

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

I wasn't sure if it'd be safe to add this hook to this component:

  const state = useSendbirdStateContext();
  const userId = state?.config?.userId;

(passing userId = '' should be safe if that hook is no good... it'd mean no behavior change here - the prior getChannelName function was already not incorporating currentUserId when joining members)

@git-babel
Copy link
Contributor

git-babel commented Dec 12, 2024

@aldenquimby Thank you for your PR. But as you said, we don't accept the external contribution. Instead, we made the fix for this issue. The fix will be included in next 3.15.10 release.

@aldenquimby aldenquimby deleted the main branch December 12, 2024 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants