Story 2490: Group Icon for Various Author cases in User Profile#2501
Conversation
|
Warning Review limit reached
Next review available in: 30 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (10)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
templates/v3/includes/_avatar_v3.html (1)
30-34: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider normalizing the
aria-labelto the canonical collective label.The wrapper exposes
aria-label="{{ name }}", which echoes the raw input. If this template is included with a non-canonical collective value (e.g.name="various"), screen readers will announce "various" rather than "Various Authors". Production paths normalize viaapply_collective_author_overridesand the demo passes a normalized string, so this is only a hardening nit for direct includes.♻️ Normalize label for direct includes
- {% if name|is_collective_author %} - <span class="avatar avatar--{{ size }} avatar--collective" role="img" aria-label="{{ name }}"> + {% if name|is_collective_author %} + <span class="avatar avatar--{{ size }} avatar--collective" role="img" aria-label="{{ name|collective_author_label }}">🤖 Prompt for 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. In `@templates/v3/includes/_avatar_v3.html` around lines 30 - 34, The collective avatar branch in _avatar_v3.html uses aria-label from the raw name value, so direct includes can announce a non-canonical label. Update the conditional branch that renders the avatar--collective span to derive the accessible label from the normalized collective author value instead of echoing name, consistent with apply_collective_author_overrides and the existing collective handling in the template.
🤖 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.
Nitpick comments:
In `@templates/v3/includes/_avatar_v3.html`:
- Around line 30-34: The collective avatar branch in _avatar_v3.html uses
aria-label from the raw name value, so direct includes can announce a
non-canonical label. Update the conditional branch that renders the
avatar--collective span to derive the accessible label from the normalized
collective author value instead of echoing name, consistent with
apply_collective_author_overrides and the existing collective handling in the
template.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: dc3126c2-a0fe-4b15-a919-bb82e891d47a
📒 Files selected for processing (10)
core/views.pylibraries/utils.pylibraries/views.pystatic/css/v3/avatar.cssstatic/css/v3/contributors-list.csstemplates/includes/icon.htmltemplates/v3/includes/_avatar_v3.htmlusers/templatetags/avatar_tags.pyusers/tests/test_avatar_tags.pyversions/views.py
julioest
left a comment
There was a problem hiding this comment.
Approved ✅ Clicked through the demo + a library page. The "Various Authors" card looks great and everything else works as expected
herzog0
left a comment
There was a problem hiding this comment.
Heya, thanks for this @julhoang!
I was just wondering if a better place to put this logic in wouldn't be the two to_v3_profile_dict methods in users/models.py and libraries/models.py.
Every array that are passed as arguments to apply_collective_author_overrides had previously been generated by to_v3_profile_dict, so I think there won't be any loose ties in this case.
Anything I'm not considering in here?
|
Hi @herzog0, thanks for raising this! I did consider that approach, but I chose to scope it down to just the Library Intro card context and the Libraries context for greater control. I noticed the |
5f915df to
da79fd3
Compare
6a0ebee to
c70016c
Compare
Issue: #2490
developSummary & Context
Renders libraries whose author is a collective label (e.g. "Various Authors") with a group icon instead of a single-person initial/avatar, and shows them as a single un-linked line with no role. Applies the same treatment everywhere library authors/contributors are listed.
Changes
Collective-author detection
is_collective_authorandcollective_author_labelfilters tousers/templatetags/avatar_tags.py— regex match on names starting with "various" (case-insensitive), with a canonical "Various Authors" display labelapply_collective_author_overrides()helper tolibraries/utils.py— for matching V3 profile dicts, setsname→ "Various Authors",profile_url→ None,role→ NoneAvatar group icon
people-groupicon totemplates/includes/icon.html_avatar_v3.html— new top-priority branch renders the group icon whennameis a collective label; rendering order is now group icon → image → initials → placeholder.avatar--collectivestyles toavatar.css— icon scales to fill the avatar container, inset by--space-mediumApply across author/contributor surfaces
apply_collective_author_overrides()into the three V3 builders that shape author/contributor dicts:libraries/utils.pybuild_library_intro_context– homepage Library Intro cardlibraries/views.pyLibraryDetail.get_v3_context_data– "This Release" and "All Contributors" listsversions/views.pyVersionDetail.get_v3_contributors– release-page contributorsDemo & tests
users/tests/test_avatar_tags.pycovering both filtersRisks & Considerations
_avatar_v3.htmlrenders the group icon for any avatar whose name starts with "various", including surfaces that don't run the override (e.g. news author cards). The name/link/role normalization is scoped to the library author/contributor paths only. Harmless in practice (real users aren't named "Various…").static/css/v3/contributors-list.cssaddsoverflow-y: autoto fix the overflow issue on the V3 demo page.Peer-Testing Guidelines
Screenshots
Self-review Checklist
Frontend
Summary by CodeRabbit
New Features
Bug Fixes
Tests