Skip to content

Feature frontend support integration

Mahri Wissal a demandé de fusionner feature-frontend-support-integration vers develop

This Merge Request delivers major enhancements to the User Experience, security alignment, and the integration of the AI Support module. It focuses on notification reliability, wallet UI accuracy, and a robust implementation of the RAG-based Assistant.

Key Changes

  1. Support & AI Assistant (RAG Integration) Intelligent Chatbot: Added the src/chatbot/ module featuring a local knowledge base (darvest-knowledge.ts).

Contextual Awareness: Outbound messages now automatically include the current page URL and relevant knowledge, capped at 8000 characters for optimal processing.

Resilience: Added error handling (4xx/5xx) and an automatic one-time retry mechanism for expired chatbot sessions (404).

UI/UX: Implemented Markdown rendering for assistant replies, typing indicators, and quick-query chips.

  1. Notification Center & Security Alignment JWT Identity: Aligned the Support API to rely on backend JWT principal. Removed manual userId forwarding in favor of the /api/support/notifications/me endpoint.

State Persistence: Synchronized read/unread states with the server (/read and /read-all endpoints) with pre-validation guards.

Security: Hardened the Axios interceptor (development-only logging, no raw JWT leaks) and secured notification redirects using safeInAppPath to prevent open redirects.

Fixes: Fixed the layout with a dedicated vertical scrollbar and resolved React Query cache isolation issues.

  1. Dashboard & UI Fixes Wallet Balance: Improved the initial state display; new users now see 0 MAD instead of a dash, ensuring a cleaner onboarding experience.

Auth Consistency: Synchronized the Support client with the shared getAccessToken() helper to ensure all modules use the same token source.

Testing Performed E2E Flow: Verified that notifications marked as read on the dashboard persist after a page refresh.

Chatbot Stress Test: Confirmed 8000-character limit enforcement and session recovery.

Security Check: Validated that Authorization headers are correctly sent without exposing user IDs in the URL.

UI Check: Confirmed the notification scrollbar and Wallet 0 MAD display on various screen sizes.

Rapports de requête de fusion