Task 2542: Boost Day and Tenure Achievements Fullstack - #2553
Draft
javiercoronadonarvaez wants to merge 6 commits into
Draft
Task 2542: Boost Day and Tenure Achievements Fullstack#2553javiercoronadonarvaez wants to merge 6 commits into
javiercoronadonarvaez wants to merge 6 commits into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
javiercoronadonarvaez
force-pushed
the
javiercoronarv/2542-boost-day-and-tenure-badge
branch
3 times, most recently
from
July 30, 2026 14:08
4587355 to
c1b8faa
Compare
- Refactor profile_badges as entry for both boost day and tenure related icons
… and in posts list
javiercoronadonarvaez
force-pushed
the
javiercoronarv/2542-boost-day-and-tenure-badge
branch
from
July 30, 2026 23:41
433f773 to
c0f43eb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: #2542
Summary & Context
Displays a tenure medal and a Boost Day celebration icon beside a member's name across the platform. Both are derived from the member's
date_joinedat render time. Nothing is stored, no admin action is needed, and no scheduled job assigns or revokes them.5942:11222) · Homepage context (node8901:96646)Changes
users/achievements.py(new): resolves both badges fromdate_joined.tenure_years(full years elapsed),tenure_tier_token,is_boost_day, plustenure_badge,boost_day_badgeandprofile_badges.users/models.py:User.profile_badges(cached) withtenure_badge/boost_day_badgepassthroughs.users/profile_cards.py,news/services.py,libraries/models.py: the other three author-dict builders emit the same two keys.CommitAuthordelegates to its linked account and yields nothing for git-only contributors.templates/v3/includes/_user_profile.html: two badge slots per Figma: the Boost Day icon inside.user-profile__name-group(beside the name), the tenure medal after.user-profile__role(beside "Contributor"/"Maintainer"). The pre-existing single-badgeprop still works for the component demo and mock data.static/css/v3/user-profile.css: comment only.users/tests/test_achievements.py(new): 52 tests: tier boundaries, anniversary edges, all four Feb-29 permutations, ordinal labels (1st/2nd/3rd/10th/11th/22nd), and a template test asserting the two icons land on opposite sides of the role element.Uses the medal tokens (
badge-tier-1…5→tier-N.png), which are the icons in the Figma and the same artwork already shown on/users/me/.star-tier-*(stars) andbadge-tier-*(medals). The Figma shows medals, and the component demo page (_v3_example_section.html:152-156) labels the stars with these exact tenure thresholds. Design confirmed the medal placement verbally; the AC wording still says "star". Tooltip copy is unchanged from the AC ("Boost Member for N years"), so the word "star" no longer appears anywhere in the UI.timezone.localdate()and not per-user timezone. A member may see their icon appear/disappear a few hours off from their own midnight._user_card.html, whose only badge slot is a featured achievement (currently hardcoded"Bug Catcher"). Wiring tenure there needs a new template prop. Testimonials have a plain-textauthorCharField with no account link, so nodate_joinedexists to derive from.date_joinedis already loaded) and it is cached per instance, but it is not cached across requests. A member crossing a tier threshold or anniversary is reflected on the next page load, by design.Screenshots
Peer Testing
Seed data caps out around 3 years' tenure, so nothing above bronze appears and no Boost Day fires unless a member's anniversary happens to be today. Backdate a user to see both icons.
1. Give your user both badges
Sets
date_joinedto N years ago on today's date, so the tenure medal and the Boost Day icon both appear. ChangeYEARSto pick a tier. Note the printedORIGINAL date_joinedso you can restore it in step 4.Expected output for
YEARS = 20:2. What to check in the browser
Open
localhost:8000/news/— the seeded posts are all by the same author, so you get ~10 instances.tabindex="0") and reveal the tooltip on focus.localhost:8000/shows other members at 2–3 years with bronze medals, so you can compare tiers side by side.3. Check the medal alone (no Boost Day)
Any date whose month/day is not today gives the medal only — this is the everyday case:
To check the opposite case — Boost Day with no medal — use
YEARS = 1in step 1. One year is below the bronze threshold, so only the 🎉 appears with "Happy 1st Boost Day".4. Restore your user
Substitute the
ORIGINAL date_joinedprinted in step 1:Tests
Self-review Checklist
Frontend