Fix initials + profile pictures #2186

Merged
ahatzz11 merged 3 commits from fix-profile-picture-and-initials into main 2025-05-02 06:43:21 +08:00
ahatzz11 commented 2025-05-02 05:29:07 +08:00 (Migrated from github.com)

This PR makes some fixes to the user_avatar. I think this might have broken in some of the recent UI updates. This does include changes from the user_avatar_form in #2185.

  • Ensures initials are passed to the _user_avatar_field partial
  • Uses the small variant for the household list
  • Fixes some small spacing on the household list
  • Changes for processing the image variant url - I would love some feedback on this change, I'll make a comment on it.

Profile picture set (no image left and improper initials):
CleanShot-002739 2025-05-01 at 16 20 52@2x

No profile picture set, expecting proper initials:
CleanShot-002748 2025-05-01 at 16 28 00@2x

Household page:
CleanShot-002751 2025-05-01 at 16 28 32@2x

This PR makes some fixes to the user_avatar. I think this might have broken in some of the recent UI updates. This does include changes from the user_avatar_form in #2185. - Ensures initials are passed to the `_user_avatar_field` partial - Uses the small variant for the household list - Fixes some small spacing on the household list - Changes for processing the image variant url - I would love some feedback on this change, I'll make a comment on it. Profile picture set (no image left _and_ improper initials): ![CleanShot-002739 2025-05-01 at 16 20 52@2x](https://github.com/user-attachments/assets/5285969e-5841-44be-9b7c-d663069d27fb) No profile picture set, expecting proper initials: ![CleanShot-002748 2025-05-01 at 16 28 00@2x](https://github.com/user-attachments/assets/32364e10-4c7d-483f-8ec4-45dddf17990c) Household page: ![CleanShot-002751 2025-05-01 at 16 28 32@2x](https://github.com/user-attachments/assets/96b501ba-a811-451e-a745-3cb836c0e8ad)
ahatzz11 (Migrated from github.com) reviewed 2025-05-02 05:32:05 +08:00
ahatzz11 (Migrated from github.com) commented 2025-05-02 05:32:05 +08:00

This is something well outside of my current (and small) knowledge of ruby - but after some googling and cursor chatting it seems like the ActiveStorage URLs need to properly be set for the images to work, and I think this has something to do with the variants? If I remove the variant references, the images in the menu/menu component work.

I also added the preprocessed to the :small variant because we know those will be used.

If there's a better way to handle this I'm happy to change it - or if this is something that differs between local dev and the real dev I can work around that as well.

This is something well outside of my current (and small) knowledge of ruby - but after some googling and cursor chatting it seems like the ActiveStorage URLs need to properly be set for the images to work, and I _think_ this has something to do with the variants? If I remove the variant references, the images in the menu/menu component work. I also added the `preprocessed` to the `:small` variant because we know those will be used. If there's a better way to handle this I'm happy to change it - or if this is something that differs between local dev and the real dev I can work around that as well.
zachgoll (Migrated from github.com) approved these changes 2025-05-02 06:42:47 +08:00
zachgoll (Migrated from github.com) left a comment

Thanks for this fix! This is a very weird one and was not happening prior to some of the recent UI changes I made, which leads me to think it has to do with the context in which we're fetching that attachment URL from.

These fixes are certainly better than the failures we're currently having so I'll get this merged and then try and dig in and see why this all of a sudden started happening and figure out if there's a more standard fix for this.

Thanks for this fix! This is a very weird one and was not happening prior to some of the recent UI changes I made, which leads me to think it has to do with the _context_ in which we're fetching that attachment URL from. These fixes are certainly better than the failures we're currently having so I'll get this merged and then try and dig in and see why this all of a sudden started happening and figure out if there's a more standard fix for this.
Sign in to join this conversation.