-
Notifications
You must be signed in to change notification settings - Fork 299
feat: add enhanced mentions #3189
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
Open
MartinCupela
wants to merge
16
commits into
master
Choose a base branch
from
feat/enhanced-mentions
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
5cabe95
feat: add enhanced mentions handling to message composition
MartinCupela cf7a491
feat: add enhanced mentions handling to message text rendering
MartinCupela 911f203
Merge branch 'master' into feat/enhanced-mentions
MartinCupela 739b573
feat(mentions): use mention_groups to correctly wrap user group mentions
MartinCupela 8bc5ceb
refactor(mentions): use ListItemLayout for MentionItem components
MartinCupela 70241a5
refactor(mentions): optimize mention item components
MartinCupela 6b507ce
Merge branch 'master' into feat/enhanced-mentions
MartinCupela 15f053d
Merge branch 'master' into feat/enhanced-mentions
MartinCupela a8c3ccd
chore: preapprove stream-chat for install within npmMinimalAgeGate
MartinCupela e9ca26f
chore(deps): upgrade stream-chat to version 9.45.0
MartinCupela 35e128a
style: add empty lines before declarations following mixins
MartinCupela b856569
fix: remove translation key aria/User Suggestions
MartinCupela 4e81248
style: add empty line following CSS variable declaration
MartinCupela b97aab8
fix(TokenizedSuggestionParts): avoid ReDoS-prone whitespace regex in …
MartinCupela 9cc2fbc
fix: reflect all mentions in message text handling
MartinCupela 601081d
chore(deps): adjust all the dependency links for stream-chat
MartinCupela File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,143 @@ | ||
| import clsx from 'clsx'; | ||
| import type { | ||
| ComponentProps, | ||
| ComponentType, | ||
| ElementType, | ||
| HTMLAttributes, | ||
| ReactNode, | ||
| } from 'react'; | ||
| import React from 'react'; | ||
|
|
||
| export type ListItemLayoutRootElement = Extract< | ||
| keyof React.JSX.IntrinsicElements, | ||
| keyof HTMLElementTagNameMap | ||
| >; | ||
|
|
||
| export type ListItemLayoutBaseProps = { | ||
| ContentSlot?: ComponentType<ListItemLayoutContentProps>; | ||
| contentClassName?: string; | ||
| description?: ReactNode; | ||
| descriptionClassName?: string; | ||
| destructive?: boolean; | ||
| LeadingIcon?: ComponentType; | ||
| LeadingSlot?: ComponentType; | ||
| selected?: boolean; | ||
| subtitle?: ReactNode; | ||
| subtitleClassName?: string; | ||
| title: ReactNode; | ||
| titleClassName?: string; | ||
| TrailingIcon?: ComponentType; | ||
| TrailingSlot?: ComponentType; | ||
| }; | ||
|
|
||
| export type ListItemLayoutProps<RootElement extends ListItemLayoutRootElement = 'div'> = | ||
| ListItemLayoutBaseProps & { | ||
| RootElement?: RootElement; | ||
| rootProps?: Omit<ComponentProps<RootElement>, 'children'>; | ||
| }; | ||
|
|
||
| export const ListItemLayout = <RootElement extends ListItemLayoutRootElement = 'div'>({ | ||
| ContentSlot = ListItemLayoutContent, | ||
| contentClassName, | ||
| description, | ||
| descriptionClassName, | ||
| destructive, | ||
| LeadingIcon, | ||
| LeadingSlot, | ||
| RootElement, | ||
| rootProps, | ||
| selected, | ||
| subtitle, | ||
| subtitleClassName, | ||
| title, | ||
| titleClassName, | ||
| TrailingIcon, | ||
| TrailingSlot, | ||
| }: ListItemLayoutProps<RootElement>) => { | ||
| const RootComponent = (RootElement ?? 'div') as ElementType< | ||
| HTMLAttributes<HTMLElement> | ||
| >; | ||
| const resolvedRootProps = { | ||
| ...(RootComponent === 'button' ? { type: 'button' } : undefined), | ||
| ...rootProps, | ||
| className: clsx( | ||
| 'str-chat__list-item-layout', | ||
| rootProps?.className, | ||
| destructive && 'str-chat__list-item-layout--destructive', | ||
| selected && 'str-chat__list-item-layout--selected', | ||
| ), | ||
| } as HTMLAttributes<HTMLElement>; | ||
|
|
||
| return ( | ||
| <RootComponent {...resolvedRootProps}> | ||
| {LeadingIcon && ( | ||
| <div className='str-chat__list-item-layout__leading-icon'> | ||
| <LeadingIcon /> | ||
| </div> | ||
| )} | ||
| {LeadingSlot && <LeadingSlot />} | ||
| <ContentSlot | ||
| className={contentClassName} | ||
| description={description} | ||
| descriptionClassName={descriptionClassName} | ||
| subtitle={subtitle} | ||
| subtitleClassName={subtitleClassName} | ||
| title={title} | ||
| titleClassName={titleClassName} | ||
| /> | ||
| {TrailingIcon && ( | ||
| <div className='str-chat__list-item-layout__trailing-icon'> | ||
| <TrailingIcon /> | ||
| </div> | ||
| )} | ||
| {TrailingSlot && <TrailingSlot />} | ||
| </RootComponent> | ||
| ); | ||
| }; | ||
|
|
||
| export type ListItemLayoutContentProps = Omit<ComponentProps<'div'>, 'title'> & { | ||
| description?: ReactNode; | ||
| descriptionClassName?: string; | ||
| subtitle?: ReactNode; | ||
| subtitleClassName?: string; | ||
| title: ReactNode; | ||
| titleClassName?: string; | ||
| }; | ||
|
|
||
| export const ListItemLayoutContent = ({ | ||
| className, | ||
| description, | ||
| descriptionClassName, | ||
| subtitle, | ||
| subtitleClassName, | ||
| title, | ||
| titleClassName, | ||
| ...props | ||
| }: ListItemLayoutContentProps) => ( | ||
| <div | ||
| {...props} | ||
| className={clsx('str-chat__list-item-layout__content', className, { | ||
| 'str-chat__list-item-layout__content--withDescription': description, | ||
| 'str-chat__list-item-layout__content--withSubtitle': subtitle, | ||
| 'str-chat__list-item-layout__content--withTitle': title, | ||
| })} | ||
| > | ||
| {title && ( | ||
| <div className={clsx('str-chat__list-item-layout__title', titleClassName)}> | ||
| {title} | ||
| </div> | ||
| )} | ||
| {subtitle && ( | ||
| <div className={clsx('str-chat__list-item-layout__subtitle', subtitleClassName)}> | ||
| {subtitle} | ||
| </div> | ||
| )} | ||
| {description && ( | ||
| <div | ||
| className={clsx('str-chat__list-item-layout__description', descriptionClassName)} | ||
| > | ||
| {description} | ||
| </div> | ||
| )} | ||
| </div> | ||
| ); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🧩 Analysis chain
🌐 Web query:
stream-chat npm package version 9.45.0 release notes💡 Result:
As of June 4, 2026, version 9.45.0 of the stream-chat npm package has not been released. The latest available versions in the stream-chat series are 9.44.0 through 9.44.2, which were published in May 2026 [1][2]. You can monitor the official GitHub repository for future release notes and version updates [3][4].
Citations:
Fix
stream-chatdependency version:^9.45.0isn’t published.In
package.json(peerDependencies/devDependencies, lines 105 and 175),stream-chatis set to^9.45.0, but the npm registry shows 9.45.0 has not been released (latest is 9.44.0–9.44.2). This will make the dependency unsatisfiable; update to a published version and then re-check whether it includes the enhanced mentions API from the dependentstream-chat-jsPR.🤖 Prompt for AI Agents