Skip to content

Jc/update avatar component#2508

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

Jc/update avatar component#2508
jlchilders11 wants to merge 3 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
    • Improved the user profile avatar editor with a clearer replace/delete/undo flow and a new overlay-based editing experience.
    • Added support for an additional arrow-return icon in the interface.
    • Refined avatar state handling so empty, default, and edited profiles display more consistently.

@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

Warning

Review limit reached

@jlchilders11, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 29 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e808456f-4fe6-43fe-a75f-b93d883c494f

📥 Commits

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

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

Walkthrough

The user profile avatar edit UI is refactored: the template loads avatar_tags, updates the avatar wrapper markup with new Replace/Delete/Undo controls and a file-field card, adds a pixel-arrow-return SVG icon, and rewrites the CSS avatar state logic using :has() selectors with a new full-screen fixed overlay cover element.

Changes

Avatar UI State Refactor

Layer / File(s) Summary
Template markup and avatar_tags wiring
templates/v3/user_profile_edit.html, templates/includes/icon.html
Loads avatar_tags, updates the avatar wrapper class list, replaces prior delete/reset button markup with new "Replace Avatar", "Delete Avatar", and "Undo Changes" controls plus a file-field card. Adds pixel-arrow-return SVG icon path to the icon template.
CSS :has()-driven avatar state rules and overlay
static/css/v3/user-profile-page.css
Replaces standalone avatar selectors with consolidated :has()-driven rules covering empty, delete, default, and edit/replace states keyed off input[id='user-profile__avatar-delete-checkbox'] and name='avatar-row-checkbox'. Adjusts .user-profile__edit-avatar-box z-index and adds a full-screen fixed .user-profile__edit-avatar-box-cover. Retains save-indicator styles with formatting normalization.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Poem

🐇 Hop hop, the avatar glows,
:has() now tracks each state it shows,
Delete or replace, undo with care,
A cover div floats high in the air,
The pixel arrow points the way—
This rabbit's profile saved the day! 🎨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the avatar component update reflected in the PR.
Description check ✅ Passed The description matches the template with issue, summary, links, changes, screenshots, and checklist; risks are only lightly filled.
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 :)

<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.

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

3 participants