Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/chat-trigger-allow-spaces.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@astryxdesign/core': patch
---

[feat] Chat: support whitespace-tolerant search queries via opt-in `allowSpaces` on `ChatComposerTrigger` with punctuation boundary and word-cap termination rules.

@Geervan
2 changes: 2 additions & 0 deletions apps/storybook/stories/ChatComposerInput.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ export const MentionTrigger: Story = {
const mentionTrigger: ChatComposerTrigger = {
character: '@',
searchSource: userSource,
allowSpaces: true,
renderItem: item => (
<TypeaheadItem
item={item}
Expand Down Expand Up @@ -356,6 +357,7 @@ export const MultipleTriggers: Story = {
const mentionTrigger: ChatComposerTrigger = {
character: '@',
searchSource: userSource,
allowSpaces: true,
onSelect: item => ({
value: `@${item.id}`,
label: item.label,
Expand Down
6 changes: 6 additions & 0 deletions packages/core/src/Chat/ChatComposerInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@ export type ChatComposerTrigger = {
loadingText?: string;
/** Accessible label for the menu. @default 'Suggestions' */
menuLabel?: string;
/**
* Whether the search query can contain spaces (e.g. for multi-word mentions like "@Jane Doe"
* or candidate browsing with "@ "). When false, the menu closes on the first space.
* @default false
*/
allowSpaces?: boolean;
};

export interface ChatComposerInputProps extends Omit<
Expand Down
Loading
Loading