@aslaluroba/help-center 3.0.11 → 3.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @aslaluroba/help-center
2
2
 
3
- A powerful and customizable help center widget for Angular applications with real-time chat functionality, AI assistance, and multi-language support.
3
+ A powerful and customizable help center widget for Angular applications with real-time chat functionality, AI assistance, multi-language support, and user feedback collection.
4
4
 
5
5
  ## Installation
6
6
 
@@ -74,6 +74,55 @@ export class AppComponent implements OnInit {
74
74
  }
75
75
  ```
76
76
 
77
+ ## User Feedback System
78
+
79
+ The widget includes a comprehensive user feedback system that collects ratings and comments after meaningful chat interactions:
80
+
81
+ ### Review Dialog Features
82
+ - **Star Rating**: 1-5 star rating system with visual feedback
83
+ - **Comment Collection**: Text area for detailed feedback (10-500 characters)
84
+ - **Smart Display**: Only appears after meaningful chat interactions (not just welcome messages)
85
+ - **Validation**: Real-time validation with error messages
86
+ - **API Integration**: Automatically submits reviews to your backend
87
+ - **Multi-language**: Fully translated interface
88
+
89
+ ### Review API Endpoint
90
+ Reviews are submitted to: `POST /Client/ClientChatSession/{sessionId}/review`
91
+
92
+ ```typescript
93
+ // Review payload structure
94
+ {
95
+ "rating": 5, // 1-5 stars
96
+ "comment": "Great help!" // 10-500 characters
97
+ }
98
+ ```
99
+
100
+ ### Review Dialog Behavior
101
+ - **Triggers**: Only after ending a chat with meaningful interaction
102
+ - **Skips**: If user just opens chat without interaction
103
+ - **Validation**: Client-side validation with real-time feedback
104
+ - **Submission**: Closes chat session first, then submits review
105
+ - **Error Handling**: Graceful handling of submission failures
106
+
107
+ ## Smart Session Management
108
+
109
+ The widget includes intelligent chat session management to provide a seamless user experience:
110
+
111
+ ### Confirmation Dialogs
112
+ - **End Chat Confirmation**: Prevents accidental loss of active conversations
113
+ - **Start New Chat Confirmation**: Warns users when switching between chat sessions
114
+ - **Smart Detection**: Distinguishes between welcome messages and meaningful interactions
115
+
116
+ ### Session Persistence
117
+ - **Back Navigation**: Chat state maintained when navigating back to help screen
118
+ - **Return to Chat**: Users can return to their previous conversation
119
+ - **Duplicate Prevention**: Intelligent message handling prevents duplicate welcome messages
120
+
121
+ ### Session States
122
+ - **Active Session**: User has meaningful interaction (not just welcome message)
123
+ - **Welcome Only**: User opened chat but didn't interact meaningfully
124
+ - **Clean State**: No previous session or messages
125
+
77
126
  ## Language Support
78
127
 
79
128
  The widget supports multiple languages with built-in RTL support. Currently available languages:
@@ -234,6 +283,17 @@ export class AppComponent {
234
283
  }
235
284
  ```
236
285
 
286
+ ## Features
287
+
288
+ - **Real-time Chat**: WebSocket-based messaging with Ably integration
289
+ - **AI Assistant**: Intelligent responses and conversation management
290
+ - **Multi-language Support**: English and Arabic with RTL support
291
+ - **User Feedback**: Review dialog for collecting ratings and comments
292
+ - **Smart Session Management**: Intelligent chat session handling with confirmation dialogs
293
+ - **Customizable Theming**: Dynamic color schemes and logo customization
294
+ - **Responsive Design**: Mobile-first approach with accessibility features
295
+ - **Duplicate Prevention**: Smart message handling to prevent duplicate content
296
+
237
297
  ## Props
238
298
 
239
299
  | Prop | Type | Required | Default | Description |
@@ -281,6 +341,30 @@ export class AppComponent {
281
341
  </app-help-center-widget>
282
342
  ```
283
343
 
344
+ ## Troubleshooting
345
+
346
+ ### Common Issues
347
+
348
+ 1. **Duplicate Welcome Messages**
349
+ - **Fixed**: The widget now intelligently detects and prevents duplicate welcome messages
350
+ - **Cause**: Previously occurred when starting new chat after going back
351
+ - **Solution**: Smart session detection and proper session clearing
352
+
353
+ 2. **Review Dialog Not Showing**
354
+ - **Expected**: Review dialog only appears after meaningful chat interactions
355
+ - **Not Showing**: If user only sees welcome message without interaction
356
+ - **Solution**: This is intentional behavior to avoid unnecessary review prompts
357
+
358
+ 3. **Chat Session Issues**
359
+ - **Session Persistence**: Chat state is maintained when navigating back
360
+ - **Confirmation Dialogs**: Prevent accidental loss of conversations
361
+ - **Smart Detection**: System distinguishes between welcome messages and real interactions
362
+
363
+ 4. **API Integration**
364
+ - **Review Endpoint**: Ensure your backend supports `POST /Client/ClientChatSession/{id}/review`
365
+ - **Token Authentication**: Verify `getToken` function returns valid JWT
366
+ - **Error Handling**: Review submission failures are handled gracefully
367
+
284
368
  ## Support
285
369
 
286
370
  For issues and feature requests, please visit our [GitHub repository](https://github.com/aslaluroba/help-center/issues).