Conversation
Render initials underneath profile photos and reveal images only after they load. Share the fallback across user avatars, viewer presence, and library headers. Cover missing and failed images, successful photos, pre-connect failures, live Turbo updates, and both themes. AGNTOPS-559 Amp-Thread-ID: https://ampcode.com/threads/T-01a0da07-fcd3-7281-9975-3b6c29b7e3ef Co-authored-by: Amp <amp@ampcode.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed and why
Fixes AGNTOPS-559.
Users with a configured but unavailable profile photo currently get a broken image instead of the initials shown for users without a photo URL. Keep initials visible while photos load, reveal successfully loaded photos, and remove failed images without changing avatar dimensions.
Use the shared fallback for plan viewers and library headers as well as existing avatar-helper consumers. Preserve profile links, accessible names, lazy loading, and live Turbo Stream updates. No external avatar service is needed.
Evidence
Synthetic users: Alex Morgan has a failed photo, Sam Rivera has no photo URL, and Taylor Chen has a valid image. Screenshots were captured from passing browser specs and visually inspected.
Testing
bundle exec rspec spec/helpers/application_helper_spec.rb spec/system/avatars_spec.rb spec/channels/coplan/plan_presence_channel_spec.rb— 20 examples, 0 failures.Browser specs exercise failed/missing/valid photos in both themes, profile-link navigation, failures completed before Stimulus connects, and live broadcast replacements without resizing.
bundle exec rubocop engine/app/helpers/coplan/application_helper.rb spec/helpers/application_helper_spec.rb spec/system/avatars_spec.rb— no offenses.node --input-type=module --check < engine/app/javascript/controllers/coplan/avatar_controller.jsandgit diff --check— passed.bundle exec rspec— 2,268 examples, 0 failures (4 minutes 27 seconds).Used Ruby 3.4 and an isolated disposable local MySQL database. No shared database changes.
Manual diff review completed. The repository's named
code-reviewskill is unavailable locally and in the skill catalog.Added real JavaScript-enabled browser specs for the changed UI behavior.
Added helper specs for initials, accessible naming, escaping, and viewer styling.
Ran the full suite to completion.
Tested affected UI in both light and dark themes.
Attached and inspected images demonstrating the fix.