Skip to content

Conversation

nouroweiss
Copy link

Fixes #1983

What kind of change does this PR introduce?

Bug fix

Why was this change needed?

When agent image URLs are broken or unavailable, a broken image icon is displayed instead of a fallback, reducing the user experience quality. This PR ensures that when an image fails to load, users see the default Robot avatar instead of a broken image placeholder.

Changes made

  • Added onError handler to AgentCard.tsx to fallback to Robot icon
  • Added onError handler and alt attribute to SharedAgentCard.tsx
  • Now displays default Robot avatar when image fails to load

Testing

I verified the logic of the onError handler through code review and created a simple test to validate the fallback behavior. Full integration testing was not possible due to local environment setup issues with Docker, but the onError pattern is a standard React approach for handling image load failures.

- Added onError handler to AgentCard.tsx to fallback to Robot icon
- Added onError handler and alt attribute to SharedAgentCard.tsx
- Fixes issue arc53#1983 where broken image URLs showed broken image icon
- Now displays default Robot avatar when image fails to load
Copy link

vercel bot commented Oct 3, 2025

@nouroweiss is attempting to deploy a commit to the Arc53 Team on Vercel.

A member of the Team first needs to authorize it.

<div className="flex w-full items-center gap-1 px-1">
<img
src={agent.image && agent.image.trim() !== '' ? agent.image : Robot}
// src={agent.image && agent.image.trim() !== '' ? agent.image : Robot}
Copy link
Collaborator

Choose a reason for hiding this comment

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

agent.image should not be replaced; only the onError attribute could be incorporated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🚀 Feature: Agent image fallback

2 participants