Skip to content

Conversation

@GeorgeDong32
Copy link
Collaborator

What this PR does

Before this PR:

  • Error icons in health indicators were not clickable and did not show detailed error info.
  • Error detail modal not exported for reuse.
  • Tooltip i18n keys and layout spacing inconsistent.

After this PR:

  • Add clickable error detail modal for model detection errors.
  • Introduce onErrorClick callback on HealthStatusIndicator to open ErrorDetailModal.
  • Export ErrorDetailModal for reuse.
  • Use SerializedError type to display richer error information.
  • Fix tooltip i18n keys and flex layout spacing.
  • Only enable clickability and render ErrorDetailModal when failed results exist to avoid extra state and improve performance.

Fixes #12367

Why we need it and why it was done in this way

The following tradeoffs were made:

  • Clickable behavior is only enabled when failures exist to avoid unnecessary state and rendering for success cases.

The following alternatives were considered:

  • Always attaching onErrorClick but avoided to prevent unnecessary renders.

Links to places where the discussion took place:

Breaking changes

  • None anticipated; behavior change is additive and conditional.

Special notes for your reviewer

  • Verify the ErrorDetailModal export and SerializedError usage.

Checklist

  • PR: The PR description is expressive enough and will help future contributors
  • Code: Write code that humans can understand and keep it simple
  • Refactor: Left the code cleaner than found
  • Upgrade: Considered impact on upgrade flows if required
  • Documentation: User-guide update considered

Release note

Add clickable error detail modal for model detection; export ErrorDetailModal; only enable clickability when failures exist to avoid extra rendering.

Copy link
Contributor

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 adds clickable error detail functionality to health status indicators in provider settings and model detection. Users can now click on error icons to view detailed error information in a modal dialog, addressing the issue where error messages were truncated in tooltips.

Changes:

  • Changed error type from string to SerializedError throughout health check system for richer error information
  • Added clickable error icons that open ErrorDetailModal with full error details
  • Exported ErrorDetailModal from ErrorBlock for reuse across the application
  • Fixed flex alignment properties and improved tooltip layouts

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/renderer/src/types/healthCheck.ts Updated ApiKeyConnectivity error type from string to SerializedError
src/renderer/src/services/HealthCheckService.ts Added error serialization logic to convert rejected promises to SerializedError objects
src/renderer/src/pages/settings/ProviderSettings/ProviderSetting.tsx Made error icon clickable, added ErrorDetailModal, and serialized errors on API check failure
src/renderer/src/pages/settings/ProviderSettings/ModelList/ModelListItem.tsx Added onErrorClick callback and ErrorDetailModal integration for model list items
src/renderer/src/pages/home/Messages/Blocks/ErrorBlock.tsx Exported ErrorDetailModal component for reuse
src/renderer/src/components/Popups/ApiKeyListPopup/hook.ts Updated error handling to use SerializedError type
src/renderer/src/components/HealthStatusIndicator/useHealthStatus.tsx Updated to access error.message from SerializedError and fixed flex alignment
src/renderer/src/components/HealthStatusIndicator/types.ts Added HealthStatusIndicatorProps interface with onErrorClick callback
src/renderer/src/components/HealthStatusIndicator/indicator.tsx Made error icon clickable when onErrorClick is provided and fixed flex alignment

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

Copy link
Contributor

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 10 out of 10 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

src/renderer/src/components/HealthStatusIndicator/indicator.tsx:53

  • The "partial" status (when some API keys pass and some fail) should also support error click functionality. Currently, onErrorClick is only handled for the "error" case, but in partial failures, users would also benefit from being able to click the warning icon to see which keys failed. Consider making the ExclamationCircleFilled icon clickable when onErrorClick is provided and there are failed results.
    case 'partial':
      icon = <ExclamationCircleFilled />
      break

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

@GeorgeDong32 GeorgeDong32 marked this pull request as ready for review January 11, 2026 12:16
@GeorgeDong32 GeorgeDong32 marked this pull request as draft January 12, 2026 04:57
@GeorgeDong32 GeorgeDong32 force-pushed the feature/add-error-detail-clickable branch 2 times, most recently from 9ca4655 to 8eabf4a Compare January 12, 2026 11:18
@GeorgeDong32 GeorgeDong32 marked this pull request as ready for review January 12, 2026 13:36
@GeorgeDong32 GeorgeDong32 requested a review from EurFelux January 12, 2026 14:05
@GeorgeDong32 GeorgeDong32 force-pushed the feature/add-error-detail-clickable branch from 6192c16 to ae407d9 Compare January 17, 2026 16:43
@GeorgeDong32 GeorgeDong32 requested a review from DeJeune January 18, 2026 03:52
@DeJeune DeJeune added this to the v1.7.14 milestone Jan 19, 2026
@GeorgeDong32 GeorgeDong32 force-pushed the feature/add-error-detail-clickable branch from ae407d9 to 45ecdac Compare January 21, 2026 05:09
- Add onErrorClick callback to HealthStatusIndicator component
- Make error icon clickable to show detailed error modal
- Export ErrorDetailModal for reuse across components
- Use SerializedError type for better error information display
- Fix tooltip i18n keys and flex layout for consistent spacing
…xist

- Only pass onErrorClick callback when there are failed results
- Conditionally render ErrorDetailModal only when needed
- Improve performance by avoiding unnecessary state for success cases
- Extract duplicated error serialization logic into serializeHealthCheckError()
  utility function in error.ts
- Update HealthCheckService.ts, hook.ts, and ProviderSetting.tsx to use
  the new utility function
- Fix invalid CSS values: align-items: left -> center, align: left -> flex-start
- Use HealthStatus.FAILED constant instead of hardcoded 'failed' string
Change the tooltip fallback translation key from the provider
API check to the models check. This ensures the displayed
message matches the new i18n key and avoids showing an
incorrect/provider-specific string when the API key
connectivity error message is absent.
- Memoize ErrorDetailModal child components (BuiltinError, AiSdkErrorBase, TruncatedCodeViewer, AiSdkError)
- Add useCallback for handleErrorClick in HealthStatusIndicator
- Add useCallback for copyErrorDetails in ErrorDetailModal
- Optimize ModelListItem button inline functions with useCallback
- HealthStatusIndicatorProps was only used in indicator.tsx, no need to export
- Keep HealthResult in types.ts as it's used by useHealthStatus hook
- useHealthStatus depends on HealthResult from ./types
- Only HealthStatusIndicatorProps belongs to indicator.tsx
- wrap healthResults in useMemo to avoid unnecessary re-renders
- remove redundant ErrorDetailModal export from ErrorBlock
- Use parseDataUrl from @shared/utils instead of manual base64 detection
- Replace duplicate ErrorDetailModal in ErrorBlock with the shared component
- Optimize onErrorClick with useMemo for better performance
@GeorgeDong32 GeorgeDong32 force-pushed the feature/add-error-detail-clickable branch from 45ecdac to c9a9bc1 Compare January 22, 2026 15:59
@kangfenmao kangfenmao merged commit 826414e into main Jan 23, 2026
3 checks passed
@kangfenmao kangfenmao deleted the feature/add-error-detail-clickable branch January 23, 2026 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Display Complete Error Information at Model Detection Location

5 participants