Skip to content

[Bug Fix] Add Avatar image fallback handling#387

Open
djalmaaraujo wants to merge 2 commits intomainfrom
da/issue-259-avatar-fallback
Open

[Bug Fix] Add Avatar image fallback handling#387
djalmaaraujo wants to merge 2 commits intomainfrom
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.
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

1 participant