You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/components/Chat/CopilotInterface.stories.tsx
+154Lines changed: 154 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -261,6 +261,7 @@ export const WithCapabilitiesDemo: Story = {
261
261
name: 'Capabilities Demo',
262
262
args: {
263
263
...baseArgs,
264
+
enableAI: false,// Disable AI to use static messages
264
265
initialTeam: 'sales',
265
266
title: 'Sales Copilot with Capabilities',
266
267
messages: [
@@ -309,6 +310,7 @@ export const WithActiveChat: Story = {
309
310
name: 'Active Chat Session',
310
311
args: {
311
312
...baseArgs,
313
+
enableAI: false,// Disable AI to use static messages
312
314
initialTeam: 'design',
313
315
title: 'Design Copilot - Active Session',
314
316
messages: [
@@ -452,6 +454,7 @@ export const AllCapabilitiesShowcase: Story = {
452
454
name: 'All Capabilities Showcase',
453
455
args: {
454
456
...baseArgs,
457
+
enableAI: false,// Disable AI to use static messages
455
458
initialTeam: 'sales',
456
459
title: 'All Capabilities Showcase',
457
460
messages: [
@@ -500,6 +503,7 @@ export const InteractiveCapabilities: Story = {
500
503
name: 'Interactive Capabilities',
501
504
args: {
502
505
...baseArgs,
506
+
enableAI: false,// Disable AI to use static messages
503
507
initialTeam: 'marketing',
504
508
title: 'Marketing Copilot - Interactive',
505
509
messages: [
@@ -548,6 +552,7 @@ export const EnhancedWithFileUpload: Story = {
548
552
name: 'Enhanced with File Upload',
549
553
args: {
550
554
...baseArgs,
555
+
enableAI: false,// Disable AI to use static messages
551
556
initialTeam: 'engineering',
552
557
title: 'Enhanced Engineering Copilot',
553
558
enableFileUpload: true,
@@ -619,6 +624,7 @@ export const LongChatHistory: Story = {
619
624
name: 'Long Chat History',
620
625
args: {
621
626
...baseArgs,
627
+
enableAI: false,// Disable AI to use static messages
622
628
initialTeam: 'engineering',
623
629
title: 'Engineering Copilot',
624
630
messages: [
@@ -707,6 +713,7 @@ export const EnhancedFeaturesShowcase: Story = {
707
713
name: 'Enhanced Features Showcase',
708
714
args: {
709
715
...baseArgs,
716
+
enableAI: false,// Disable AI to use static messages
710
717
initialTeam: 'engineering',
711
718
title: 'Enhanced AI Assistant',
712
719
enableFileUpload: true,
@@ -818,6 +825,7 @@ export const FileUploadDemo: Story = {
818
825
name: 'File Upload Demo',
819
826
args: {
820
827
...baseArgs,
828
+
enableAI: false,// Disable AI to use static messages
821
829
initialTeam: 'design',
822
830
title: 'File Upload Assistant',
823
831
enableFileUpload: true,
@@ -981,3 +989,149 @@ export const NoDataProvided: Story = {
981
989
},
982
990
},
983
991
}
992
+
993
+
exportconstLongTextMessages: Story={
994
+
name: 'Long Text Messages',
995
+
args: {
996
+
...baseArgs,
997
+
enableAI: false,// Disable AI to use static messages
998
+
initialTeam: 'design',
999
+
title: 'Design Copilot - Long Messages Test',
1000
+
messages: [
1001
+
{
1002
+
id: "1",
1003
+
role: "user",
1004
+
parts: [
1005
+
{
1006
+
type: "text",
1007
+
text: "Can you provide me with a comprehensive overview of modern design systems, including their key components, implementation strategies, and best practices for maintaining consistency across large-scale digital products and platforms?"
1008
+
}
1009
+
]
1010
+
},
1011
+
{
1012
+
id: "2",
1013
+
role: "assistant",
1014
+
parts: [
1015
+
{
1016
+
type: "text",
1017
+
text: `Absolutely! Here's a comprehensive overview of modern design systems:
1018
+
1019
+
**What is a Design System?**
1020
+
1021
+
A design system is a collection of reusable components, patterns, and guidelines that enable teams to build consistent, scalable user interfaces across products and platforms. It serves as the single source of truth for design decisions, bridging the gap between design and development.
Begin with core components and foundational elements before expanding to complex patterns. This allows for validation and refinement before wide adoption.
1054
+
1055
+
2. **Cross-functional Collaboration**
1056
+
Involve designers, developers, product managers, and content strategists from the beginning to ensure the system meets everyone's needs.
• **Documentation**: Storybook, Chromatic for visual testing
1100
+
• **Distribution**: NPM packages, CDNs, or internal registries
1101
+
1102
+
Modern design systems are living, breathing entities that evolve with your product and organization. The key to success lies in treating them as products themselves, with dedicated resources, clear ownership, and continuous improvement based on user feedback.
1103
+
1104
+
Would you like me to dive deeper into any specific aspect of design systems?`
1105
+
}
1106
+
]
1107
+
},
1108
+
{
1109
+
id: "3",
1110
+
role: "user",
1111
+
parts: [
1112
+
{
1113
+
type: "text",
1114
+
text: "This is a test of an extremely long user message to ensure that the chat interface properly handles text wrapping and width constraints. When users write very lengthy messages that contain multiple sentences, paragraphs, and extensive content, the interface should maintain proper formatting and not cause the layout to break or become too wide. The message bubble should respect the maximum width constraints while ensuring that the text is still readable and properly formatted. This is especially important in professional environments where users might paste large amounts of text, write detailed specifications, or engage in lengthy discussions about complex topics. The chat interface should gracefully handle all of these scenarios while maintaining a clean, professional appearance that doesn't compromise the overall user experience or visual design of the application."
1115
+
}
1116
+
]
1117
+
},
1118
+
{
1119
+
id: "4",
1120
+
role: "assistant",
1121
+
parts: [
1122
+
{
1123
+
type: "text",
1124
+
text: "Perfect! Your long message demonstrates exactly what we needed to test. As you can see, the chat interface now properly handles very long text messages by:\n\n• **Width Constraints**: The overall chat container is limited to max-w-4xl to prevent excessive horizontal expansion\n• **Text Wrapping**: Using break-words CSS property to ensure long words don't overflow\n• **Message Bubbles**: Individual messages respect the max-w-[80%] constraint while maintaining readability\n• **Whitespace Handling**: The whitespace-pre-wrap property preserves intentional line breaks\n• **Visual Hierarchy**: Long messages maintain proper spacing and visual separation\n\nThese improvements ensure that whether users are discussing brief topics or engaging in detailed technical conversations, the interface remains functional, visually appealing, and easy to read across all device sizes."
1125
+
}
1126
+
]
1127
+
}
1128
+
],
1129
+
},
1130
+
parameters: {
1131
+
docs: {
1132
+
description: {
1133
+
story: 'Demonstrates how the CopilotInterface handles very long text messages with proper width constraints, text wrapping, and formatting to ensure readability and visual consistency.',
text: 'Can you write me a comprehensive analysis of the current state of artificial intelligence and machine learning technologies, including their applications, limitations, and future prospects?'
19
+
}
20
+
]
21
+
},
22
+
{
23
+
id: '2',
24
+
role: 'assistant',
25
+
parts: [
26
+
{
27
+
type: 'text',
28
+
text: `Here's a comprehensive analysis of the current state of AI and ML technologies:
29
+
30
+
**Current State of Artificial Intelligence and Machine Learning**
31
+
32
+
Artificial Intelligence (AI) and Machine Learning (ML) have experienced unprecedented growth and adoption across virtually every industry in recent years. We're currently in what many experts consider the "golden age" of AI, characterized by breakthrough achievements in natural language processing, computer vision, and autonomous systems.
33
+
34
+
**Key Applications:**
35
+
36
+
1. **Natural Language Processing**: Large Language Models like GPT-4, Claude, and others have revolutionized how we interact with computers, enabling conversational AI, content generation, code assistance, and translation services that approach human-level quality.
37
+
38
+
2. **Computer Vision**: AI systems can now accurately identify objects, faces, and scenes in images and videos, powering applications from medical imaging diagnosis to autonomous vehicle navigation and augmented reality experiences.
39
+
40
+
3. **Recommendation Systems**: Platforms like Netflix, Amazon, and Spotify use sophisticated ML algorithms to personalize user experiences, driving significant business value and user engagement.
41
+
42
+
4. **Healthcare**: AI is transforming medical diagnosis, drug discovery, and treatment planning, with systems that can detect diseases earlier and more accurately than human specialists in some cases.
43
+
44
+
5. **Financial Services**: From fraud detection and algorithmic trading to credit scoring and risk assessment, ML models are integral to modern financial operations.
45
+
46
+
**Current Limitations:**
47
+
48
+
Despite remarkable progress, several significant limitations remain:
49
+
50
+
1. **Data Quality and Bias**: AI systems are only as good as the data they're trained on, and biased or incomplete datasets can lead to unfair or inaccurate outcomes.
51
+
52
+
2. **Interpretability**: Many advanced AI models, particularly deep neural networks, operate as "black boxes," making it difficult to understand how they arrive at specific decisions.
53
+
54
+
3. **Energy Consumption**: Training and running large AI models requires substantial computational resources and energy, raising environmental concerns.
55
+
56
+
4. **Generalization**: While AI excels in specific domains, achieving artificial general intelligence (AGI) that can perform any intellectual task remains elusive.
57
+
58
+
5. **Safety and Alignment**: Ensuring AI systems behave safely and align with human values becomes increasingly challenging as they become more powerful.
59
+
60
+
**Future Prospects:**
61
+
62
+
The future of AI holds immense promise across multiple dimensions:
63
+
64
+
1. **Multimodal AI**: Integration of text, image, audio, and video processing will enable more natural and comprehensive AI interactions.
65
+
66
+
2. **Edge AI**: Deployment of AI directly on devices will reduce latency, improve privacy, and enable offline functionality.
67
+
68
+
3. **AI-Assisted Scientific Discovery**: AI will accelerate research in fields like materials science, climate modeling, and space exploration.
69
+
70
+
4. **Personalized Education**: Adaptive learning systems will provide customized educational experiences tailored to individual learning styles and pace.
71
+
72
+
5. **Sustainable AI**: Development of more efficient algorithms and hardware will reduce the environmental impact of AI systems.
73
+
74
+
The next decade will likely see AI becoming even more integrated into our daily lives, while addressing current limitations through improved techniques, better governance frameworks, and more sustainable practices. The key will be balancing innovation with responsible development to ensure AI benefits humanity as a whole.`
75
+
}
76
+
]
77
+
},
78
+
{
79
+
id: '3',
80
+
role: 'user',
81
+
parts: [
82
+
{
83
+
type: 'text',
84
+
text: 'This is an extremely long message to test the width constraints of the chat interface and ensure that even when I write a very long message that goes on and on and on, it still maintains proper formatting and doesn\'t cause the chat interface to become too wide or break the layout. The message should wrap properly and maintain readability while staying within the maximum width constraints that have been set for the chat bubbles. This is important for user experience and ensuring that the interface remains functional and visually appealing even with extensive text content.'
85
+
}
86
+
]
87
+
},
88
+
{
89
+
id: '4',
90
+
role: 'assistant',
91
+
parts: [
92
+
{
93
+
type: 'text',
94
+
text: 'Perfect! Your long message demonstrates exactly what we needed to test. As you can see, the chat interface now properly handles long text messages by:\n\n• Constraining the overall chat width with max-w-4xl\n• Using break-words to prevent text overflow\n• Maintaining the max-w-[80%] constraint on individual message bubbles\n• Preserving whitespace and line breaks with whitespace-pre-wrap\n• Ensuring proper text wrapping for readability\n\nThe interface remains visually appealing and functional regardless of message length, which is crucial for a good user experience.'
0 commit comments