Skip to content

Story 2490: Group Icon for Various Author cases in User Profile#2501

Merged
julhoang merged 2 commits into
developfrom
julia/various-authors-design
Jul 13, 2026
Merged

Story 2490: Group Icon for Various Author cases in User Profile#2501
julhoang merged 2 commits into
developfrom
julia/various-authors-design

Conversation

@julhoang

@julhoang julhoang commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Issue: #2490

⚠️ Base branch is Homepage Popular Search Term (#2481), not develop ⚠️

Summary & 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

  • Add is_collective_author and collective_author_label filters to users/templatetags/avatar_tags.py — regex match on names starting with "various" (case-insensitive), with a canonical "Various Authors" display label
  • Add apply_collective_author_overrides() helper to libraries/utils.py — for matching V3 profile dicts, sets name → "Various Authors", profile_url → None, role → None

Avatar group icon

  • Add people-group icon to templates/includes/icon.html
  • Update _avatar_v3.html — new top-priority branch renders the group icon when name is a collective label; rendering order is now group icon → image → initials → placeholder
  • Add .avatar--collective styles to avatar.css — icon scales to fill the avatar container, inset by --space-medium

Apply across author/contributor surfaces

  • Wire apply_collective_author_overrides() into the three V3 builders that shape author/contributor dicts:
    • libraries/utils.py build_library_intro_context – homepage Library Intro card
    • libraries/views.py LibraryDetail.get_v3_context_data – "This Release" and "All Contributors" lists
    • versions/views.py VersionDetail.get_v3_contributors – release-page contributors

Demo & tests

  • Add a "Various Authors" case to the V3 Demo page's User Profile section.
  • Add users/tests/test_avatar_tags.py covering both filters

Risks & Considerations

  • Broad regex match: any name starting with "various" is treated as collective. This is intended for the first iteration (only known case: Boost.Math), but note it now applies to contributor lists too, not just the intro card.
  • Template-level detection is global: _avatar_v3.html renders 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…").
  • Unrelated change: static/css/v3/contributors-list.css adds overflow-y: auto to fix the overflow issue on the V3 demo page.

Peer-Testing Guidelines

  1. Visit http://localhost:8000/v3/demo/components/#user-profile — the last entry ("Various Authors") should render the group icon with a single name line, no role, and no profile link. Confirm the surrounding individual profiles are unchanged.
  2. To set up Boost.Math as featured library on homepage: Visit http://localhost:8000/cms/settings/core/homepagesettings/1/ and select "Math"
Screenshot 2026-06-24 at 1 05 43 PM 3. Re-load the homepage Library Intro card and confirm the group icon + single line. 4. Open a library detail page (http://localhost:8000/library/latest/math/); confirm the contributor cards give any collective author the same treatment and that normal contributors keep their avatar/role/link.

Screenshots

Before After
Screenshot 2026-06-24 at 1 08 46 PM Screenshot 2026-06-24 at 1 08 09 PM
Screenshot 2026-06-24 at 1 09 55 PM Screenshot 2026-06-24 at 1 10 41 PM
Screenshot 2026-06-24 at 1 10 10 PM Screenshot 2026-06-24 at 1 10 33 PM

Self-review Checklist

  • Tag at least one team member from each team to review this PR
  • 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

    • Added support for a collective “Various Authors” profile style across contributor and author displays.
    • Introduced a group/avatar icon for collective author entries.
  • Bug Fixes

    • Improved contributor rendering so collective author names display consistently with the correct label and missing profile link/role.
    • Updated contributor lists to better handle overflow in tall layouts.
  • Tests

    • Added coverage for collective-author detection and label normalization.

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 30 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: 7c2564bf-da82-4a64-9b33-f3c1ddab4925

📥 Commits

Reviewing files that changed from the base of the PR and between 6a0ebee and c70016c.

📒 Files selected for processing (10)
  • core/views.py
  • libraries/utils.py
  • libraries/views.py
  • static/css/v3/avatar.css
  • static/css/v3/contributors-list.css
  • templates/includes/icon.html
  • templates/v3/includes/_avatar_v3.html
  • users/templatetags/avatar_tags.py
  • users/tests/test_avatar_tags.py
  • versions/views.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch julia/various-authors-design

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.

@julhoang julhoang changed the title feat: add new group icon for various author cases in user profile Story 2490: Group Icon for Various Author cases in User Profile Jun 24, 2026
@julhoang julhoang marked this pull request as ready for review June 24, 2026 20:16

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

🧹 Nitpick comments (1)
templates/v3/includes/_avatar_v3.html (1)

30-34: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider normalizing the aria-label to 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 via apply_collective_author_overrides and 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

📥 Commits

Reviewing files that changed from the base of the PR and between 8d97155 and 6a0ebee.

📒 Files selected for processing (10)
  • core/views.py
  • libraries/utils.py
  • libraries/views.py
  • static/css/v3/avatar.css
  • static/css/v3/contributors-list.css
  • templates/includes/icon.html
  • templates/v3/includes/_avatar_v3.html
  • users/templatetags/avatar_tags.py
  • users/tests/test_avatar_tags.py
  • versions/views.py

@julioest julioest self-requested a review June 29, 2026 21:26

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

Approved ✅ Clicked through the demo + a library page. The "Various Authors" card looks great and everything else works as expected

@herzog0 herzog0 self-requested a review July 2, 2026 16:56

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

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?

@julhoang

julhoang commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator Author

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 to_v3_profile_dict method is used across a wider variety of cases (e.g. post authors, possibly Boost user profiles, etc.), so with a generic regex matching only "Various", I'd prefer to keep the scope of impact contained. Does this sound reasonable to you?

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

@julhoang yep, sure thing, approved then, thanks!

@julhoang julhoang force-pushed the julia/homepage-search-popular-terms branch 2 times, most recently from 5f915df to da79fd3 Compare July 8, 2026 19:06
Base automatically changed from julia/homepage-search-popular-terms to develop July 8, 2026 19:11
@julhoang julhoang force-pushed the julia/various-authors-design branch from 6a0ebee to c70016c Compare July 13, 2026 17:23

@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

@julhoang julhoang merged commit 865a4ac into develop Jul 13, 2026
5 checks passed
@julhoang julhoang deleted the julia/various-authors-design branch July 13, 2026 23:36
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: Homepage – Show group icon for collective author labels (e.g. "Various Authors")

4 participants