Skip to content

Jc/update avatar component#2508

Open
jlchilders11 wants to merge 5 commits into
developfrom
jc/update-avatar-component
Open

Jc/update avatar component#2508
jlchilders11 wants to merge 5 commits into
developfrom
jc/update-avatar-component

Conversation

@jlchilders11

@jlchilders11 jlchilders11 commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Issue: #2496

Summary & Context

Updates the Avatar Component to match with the updated design and styling.

Changes

  • Adds empty state to avatar component
  • Updates Fill state to have a modal like functionality, in which there are no buttons, but clicking off the object causes it to close
  • Adds delete state.

‼️ Risks & Considerations ‼️

Please list any potential risks or areas that need extra attention during review/testing

Screenshots

Empty State:

image

Filled State:

image

Edit State:

image

Delete State:

image

Self-review Checklist

  • Link this PR to the related GitHub Project ticket

Frontend

  • UI implementation matches Figma design
  • Tested in light and dark mode
  • Responsive / mobile verified
  • Accessibility checked (keyboard navigation, etc.)
  • Ensure design tokens are used for colors, spacing, typography, etc. – No hardcoded values
  • Test without JavaScript (if applicable)
  • No console errors or warnings

Summary by CodeRabbit

  • New Features

    • Upgraded the user profile avatar editor with a clearer replace/delete/undo flow and a new overlay-based editing experience.
    • Added support for the pixel-arrow-return icon.
    • Enhanced file upload field rendering to support an optional custom id value.
  • UI Improvements

    • Refined avatar UI state behavior (empty, default, edit, and delete) for more consistent show/hide behavior.
    • Updated avatar overlay stacking and removed the previous save/reset button row.

@jlchilders11 jlchilders11 linked an issue Jun 30, 2026 that may be closed by this pull request
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d019d406-e0af-43f7-ab93-71d7e8fdf2cb

📥 Commits

Reviewing files that changed from the base of the PR and between 66324cc and df24131.

📒 Files selected for processing (3)
  • static/css/v3/user-profile-page.css
  • templates/v3/includes/_field_file.html
  • templates/v3/user_profile_edit.html
🚧 Files skipped from review as they are similar to previous changes (1)
  • templates/v3/user_profile_edit.html

📝 Walkthrough

Walkthrough

The avatar edit UI now uses revised checkbox and label controls, optional file-field IDs, consolidated CSS state selectors, and a full-screen overlay cover. The template adds a return icon and removes obsolete close-button reset handling.

Changes

Avatar editing controls and template support

Layer / File(s) Summary
Avatar controls and supporting template wiring
templates/v3/user_profile_edit.html, templates/v3/includes/_field_file.html, templates/includes/icon.html
Adds avatar edit controls, supports explicit file-field IDs, loads avatar_tags, and renders the pixel-arrow-return icon path.
Avatar state selectors and overlay
static/css/v3/user-profile-page.css
Consolidates empty, delete, default, and replace state visibility rules and adds the edit overlay cover while retaining save-indicator styling.
Removed obsolete avatar reset handling
templates/v3/user_profile_edit.html
Removes the deleted close-button selector and its avatar reset click handler.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers: julhoang, ycanales, julioest

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and clearly describes the main change to the avatar component.
Description check ✅ Passed The description follows the template and includes the issue, summary, changes, links, screenshots, and checklist.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jc/update-avatar-component

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@static/css/v3/user-profile-page.css`:
- Around line 207-214: The delete-state selector in user-profile__avatar-row
only hides the avatar image and action buttons, so if the replace panel is
already open it can remain visible when both checkboxes are checked. Update the
delete-state rule in the avatar delete-checkbox branch to also hide the
replacement panel/card that is controlled by the replace flow, using the
existing avatar row and replacement panel selectors so delete always wins over
replace.

In `@templates/v3/user_profile_edit.html`:
- Line 108: The accessible name on the Undo Changes control is incorrect because
the `label` for `user-profile__avatar-delete-checkbox` uses `aria-label="Delete
Avatar"` and overrides the visible text. Update the `label` in the
`user_profile_edit` template so its accessible name matches the displayed
action, or remove the conflicting aria-label entirely if the visible text is
sufficient. Make sure the `Undo Changes` control announced by assistive tech
matches its actual purpose.
- Around line 103-112: The avatar upload section is rendering two file inputs
through the same `_field_file.html` partial with the same generated id, so the
“Replace Image” label can target the wrong control. Update the
`user_profile_edit.html` usage of `_field_file.html` so each avatar file input
gets a distinct id (for example by adding an explicit id parameter to the
partial or making the empty-state field non-labelable), and ensure the labels in
the avatar controls continue to point to the intended input.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 76905191-5c22-43fc-a6ad-fbc03f0759fb

📥 Commits

Reviewing files that changed from the base of the PR and between d004c67 and 66324cc.

📒 Files selected for processing (3)
  • static/css/v3/user-profile-page.css
  • templates/includes/icon.html
  • templates/v3/user_profile_edit.html

Comment thread static/css/v3/user-profile-page.css
Comment thread templates/v3/user_profile_edit.html Outdated
Comment thread templates/v3/user_profile_edit.html Outdated
@ycanales ycanales self-requested a review July 1, 2026 17:11

@ycanales ycanales left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Worked as intended and persisting the changes is out of scope for this ticket. Have wo comments but they're not blockers. Approving :)

Comment thread templates/v3/user_profile_edit.html Outdated
<input type="checkbox" id="user-profile__avatar-row-checkbox" name="avatar-row-checkbox" class="badge-button__radio" />
{% include 'v3/includes/_field_file.html' with name=user_profile_form.avatar.name extra_class='user-profile__empty-avatar-input' accept='image/png,image/jpeg' only %}
<div class="user-profile__default-space-col user-profile__default-avatar-buttons">
<label for="user-profile__avatar-row-checkbox" class="btn btn-primary">Replace Avatar<span class="btn-icon" aria-hidden>{% include 'includes/icon.html' with icon_name='pixel-pencil' icon_size=16 icon_viewbox='0 0 16 16' only %}</span></label>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In Figma the Replace Avatar button has a white background, and both buttons are a bit wider (seems to have more horizontal padding).

Image

<div class="user-profile__default-space-col user-profile__activated-avatar-buttons">
<div class="user-profile__avatar-edit-button-row">
<label aria-label="Save Avatar Change" id="avatar-row__save-button" for="user-profile__avatar-row-checkbox" class="btn btn-primary"><span class="btn-icon" aria-hidden>{% include 'includes/icon.html' with icon_name='pixel-pencil' icon_size=16 icon_viewbox='0 0 16 16' only %}</span></label>
<label aria-label="Reset Avatar Change" id="avatar-row__close-button" for="user-profile__avatar-row-checkbox" class="btn btn-primary"><span class="btn-icon" aria-hidden>{% include 'includes/icon.html' with icon_name='pixel-trash' icon_size=16 icon_viewbox='0 0 16 16' only %}</span></label>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Since the mechanism changed, do we need to clean up the avatarRowClose lines in v3/user_profile_edit.html ?

@herzog0 herzog0 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good, thanks!!
I'm pre-approving, as I only have one small nit to consider:

Image

the img and container radii seem to not be matching, creating this small gap in the corners.

Not a must-do from my pov, and you can only notice it in dark mode.

@kattyode kattyode left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

QA Approved

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.

Task: Edit Profile UI - Avatar Update

4 participants