Skip to content

[Bug Fix] Add Avatar image fallback handling#387

Merged
cirdes merged 2 commits into
mainfrom
da/issue-259-avatar-fallback
May 12, 2026
Merged

[Bug Fix] Add Avatar image fallback handling#387
cirdes merged 2 commits into
mainfrom
da/issue-259-avatar-fallback

Conversation

@djalmaaraujo
Copy link
Copy Markdown
Contributor

Summary

  • Add a CSP-friendly Stimulus controller for Avatar load/error handling
  • Hide AvatarImage until it loads successfully and keep AvatarFallback visible on load failures
  • Register the docs controller copy and add component markup coverage

Closes #259

Testing

  • docker run --rm -v ruby_ui_bundle:/usr/local/bundle -v /Users/djalmaaraujo/dev/linkana/ruby_ui-issue-259:/workspace -w /workspace/gem ruby:3.4.7 bash -lc 'bundle install && bundle exec rake test TEST=test/ruby_ui/avatar_test.rb'

@djalmaaraujo djalmaaraujo requested a review from cirdes as a code owner May 7, 2026 13:29
Image was hidden by default and only revealed by the Stimulus
controller's load handler, which meant clients with JS disabled
never saw the avatar image. Make the image visible by default and
let the controller hide it on connect when it isn't yet loaded;
load/error events restore the proper image/fallback toggle.
Copy link
Copy Markdown
Collaborator

@cirdes cirdes left a comment

Choose a reason for hiding this comment

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

looks awesome!

@cirdes cirdes merged commit 442321f into main May 12, 2026
4 checks passed
@cirdes cirdes deleted the da/issue-259-avatar-fallback branch May 12, 2026 00:32
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.

Avatar styles broken on Firefox

2 participants