chore(DATAGO-118598): Replacing error toasts with error dialogs in prompts
This pull request refactors several frontend components to improve error handling and notification consistency, and replaces legacy API utility functions with newer, standardized fetch helpers. The changes enhance user feedback for both successful and failed operations, streamline API calls, and reduce duplicated code for error reporting.
Error handling and user notifications:
- Introduced the
displayErrorfunction fromuseChatContextacross components for consistent error reporting, replacing direct calls toaddNotificationfor errors. This provides users with clearer, more actionable error dialogs. [1] [2] [3] [4] [5] [6] [7] [8] [9] - Improved success notification messages to include status types (e.g., "success") for better UI feedback. [1] [2] [3]
- Removed aggressive error dialogs for clipboard failures, logging them to the console instead.
API call refactoring:
- Replaced the legacy
authenticatedFetchutility with new helpers:fetchWithError,fetchJsonWithError, andgetErrorMessagefor more robust error handling and simpler API usage. This change is applied across chat, session, and prompts components. [1] [2] [3] [4] - Updated API calls in
SessionList,PromptsCommand,FlowChartDetails, andPromptsPageto use these new fetch utilities, reducing boilerplate and improving error handling. [1] [2] [3] [4] [5] [6]
Codebase improvements and cleanup:
- Simplified file downloads by introducing the
downloadBlobhelper and removing manual DOM manipulation for downloads. [1] [2] - Minor import cleanups and type consolidations for better maintainability. [1] [2]
Prompts and session management enhancements:
- Refactored prompt group fetching and editing in
PromptsPageto use standardized fetch helpers and improved error dialogs. [1] [2] - Improved session moving logic to provide clearer error feedback and use new fetch helpers. [1] [2]
Component API consistency:
- Updated context hooks and props to include
displayErrorwhere needed, ensuring all components have access to improved error handling. [1] [2] [3] [4]
These changes collectively improve the reliability and user experience of the frontend application, especially around error handling and API interactions.
WhiteSource Policy Violation Summary
✅︎ No Blocking Whitesource Policy Violations found in solaceai/solace-agent-mesh-ui-pr-608!