no items test

This commit is contained in:
Nate Kelley 2025-10-01 11:57:56 -06:00
parent 0b37b96377
commit 3f8a733def
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
3 changed files with 29 additions and 73 deletions

View File

@ -208,52 +208,3 @@ export const NoShortcuts: Story = {
},
},
};
export const CustomPrompts: Story = {
args: {
defaultValue: '',
onSubmit: fn(),
onStop: fn(),
submitting: false,
disabled: false,
shortcuts: mockShortcuts,
suggestedPrompts: {
report: [
'Create a detailed financial summary for stakeholders',
'Generate monthly performance metrics report',
'Analyze year-over-year growth trends',
'Compile customer satisfaction survey results',
'Prepare executive dashboard summary',
],
dashboard: [
'Build an interactive sales performance dashboard',
'Create a real-time inventory monitoring dashboard',
'Design customer analytics dashboard',
'Set up operational KPI dashboard',
'Develop marketing campaign performance dashboard',
],
visualization: [
'Show revenue trends by product category',
'Create geographic sales distribution map',
'Visualize customer journey funnel',
'Display seasonal demand patterns',
'Chart employee productivity metrics',
],
help: [
'What data visualization options are available?',
'How do I create custom metrics?',
'What are the best practices for dashboard design?',
'Can you explain predictive analytics features?',
'How do I share reports with my team?',
],
},
},
parameters: {
docs: {
description: {
story:
'Chat input with custom suggested prompts - demonstrates how the component handles larger sets of suggestions (ensures 4 unique samples are selected).',
},
},
},
};

View File

@ -109,7 +109,7 @@ export const BusterChatInputButtons = React.memo(
)}
<AppTooltip
delayDuration={disableSubmit ? 500 : 0}
title={disableSubmit ? 'Please type something...' : 'Submit'}
title={disableSubmit ? 'Please type something...' : submitting ? null : 'Submit'}
>
<Button
rounding={'large'}

View File

@ -39,13 +39,17 @@ export const useCreateShortcutsMentionsSuggestions = (
trigger: SHORTCUT_MENTION_TRIGGER,
items: ({ defaultQueryMentionsFilter, editor, query }) => {
const shortcuts = currentItemsRef.current;
const allItems: MentionInputTriggerItem[] = [
{
const allItems: MentionInputTriggerItem[] = [];
if (shortcuts.length > 0) {
allItems.push({
type: 'group',
items: shortcuts.map((s) => createShortcutForMention(s, editor)),
className: 'max-h-[300px] overflow-y-auto',
},
{ type: 'separator' as const },
});
allItems.push({ type: 'separator' as const });
}
allItems.push(
...[
{
value: 'manageShortcuts',
label: 'Manage shortcuts',
@ -66,7 +70,8 @@ export const useCreateShortcutsMentionsSuggestions = (
setOpenCreateShortcutModal(true);
},
},
];
]
);
return defaultQueryMentionsFilter(query, allItems);
},
popoverContent: ShortcutPopoverContent,