Skip to content

Conversation

@bburda
Copy link
Contributor

@bburda bburda commented Dec 2, 2025

Pull Request

Summary

  • Add toast notification when fetching entity details fails (e.g. timeout)
  • Update `selectEntity` store action to set a fallback entity with error state instead of clearing selection
  • Enhance `EntityDetailPanel` to display an error card while preserving the entity header context
  • Prevent the UI from reverting to an empty state when a single entity request fails

Issue


Type

  • Bug fix
  • New feature
  • Breaking change
  • Documentation only

Testing

manual testing + npm lint + npm build


Checklist

  • Breaking changes are clearly described (and announced in docs / changelog if needed)
  • Linting passes (npm run lint)
  • Build succeeds (npm run build)
  • Docs were updated if behavior or public API changed

- Add toast notification when fetching entity details fails (e.g. timeout)
- Update \`selectEntity\` store action to set a fallback entity with error state instead of clearing selection
- Enhance \`EntityDetailPanel\` to display an error card while preserving the entity header context
- Prevent the UI from reverting to an empty state when a single entity request fails
@bburda bburda requested review from Copilot and mfaferek93 December 2, 2025 16:37
@bburda bburda self-assigned this Dec 2, 2025
@bburda bburda added the enhancement New feature or request label Dec 2, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances error handling for entity detail fetching by adding user-friendly toast notifications and preventing the UI from clearing when requests fail. Instead of reverting to an empty state, the application now displays an error message while preserving the entity context in the header.

Key Changes:

  • Added toast notification when entity detail fetching fails, with fallback entity state to maintain UI context
  • Refactored EntityDetailPanel to use unified conditional rendering with dedicated error state display
  • Removed redundant console.error calls in store actions where toast notifications provide user feedback

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/lib/store.ts Enhanced selectEntity error handling to set fallback entity with error state instead of clearing selection; added toast notification for failures; removed redundant console.error statements
src/components/EntityDetailPanel.tsx Refactored conditional rendering to support error state display while preserving entity header; unified component structure to reduce code duplication

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Add toast notifications for API failures (entity details, children loading)
- Display fallback UI panel when entity details fail to load instead of empty state
- Infer entity type from path structure for better error context
- Add explicit error property to SovdEntityDetails interface
- Improve error messages: include details for HTTP errors, friendly JSON validation
- Remove unnecessary console.error calls and try/catch wrappers
- Fix duplicate toast on auto-connect failure (React Strict Mode)
- Add request timeout handling with user-friendly messages
@bburda bburda force-pushed the feat/improve-error-handling branch from 4bf61b0 to 75a3ae8 Compare December 2, 2025 18:08
@bburda bburda merged commit bf61046 into main Dec 2, 2025
2 checks passed
@bburda bburda deleted the feat/improve-error-handling branch December 2, 2025 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve error messages

3 participants