Skip to content

PROD - AI Ratings#1977

Merged
jmgasper merged 139 commits into
masterfrom
dev
Jun 23, 2026
Merged

PROD - AI Ratings#1977
jmgasper merged 139 commits into
masterfrom
dev

Conversation

@jmgasper

Copy link
Copy Markdown
Collaborator

Related JIRA Ticket:

https://topcoder.atlassian.net/browse/

What's in this PR?

jmgasper added 30 commits June 4, 2026 10:25
What was broken
The rating info popup rendered the pyramid graphic as its own summary cell between overall rating and position, which separated the triangle from the position data.

Root cause
The summary grid defined three columns and rendered the pyramid as a standalone grid item with its own divider, instead of grouping it with the position metric.

What was changed
Moved the pyramid markup inside the position summary cell and updated the summary grid styles so the position cell contains both the pyramid and position text, including responsive behavior.

Any added/updated tests
Added a MemberRatingInfoModal rendering test that verifies the position summary cell contains both the position data and the pyramid graphic.
What was broken
The AI rating comparison popup used smaller Roboto text for the title, body copy, summary labels, percentile value, distribution heading, and legend labels than the PM-5260 design required. The distribution heading could also inherit uppercase styling.

Root cause (if identifiable)
The modal stylesheet carried the initial PM-5261 typography values instead of the updated Figma and Jira font sizes and Barlow title treatment.

What was changed
Updated the rating info modal typography to use Barlow 22px for the title, 16px body, summary, and section text, 32px percentile text, sentence-case distribution heading styling, and larger legend range and tier labels.

Any added/updated tests
Updated the MemberRatingInfoModal spec to assert the distribution heading renders in sentence case.
What was broken
Award icons on the compact profile Awards section used native browser title tooltips, so hover text rendered with inconsistent default styling.

Root cause (if identifiable)
CommunityAwards assigned badge names through the title attribute instead of the shared Tooltip component used elsewhere.

What was changed
Wrapped each award button with the shared Tooltip component and removed the native title attribute so the badge name appears in the formatted tooltip.

Any added/updated tests
Added a CommunityAwards regression test asserting award buttons no longer render title attributes and pass the badge name to the tooltip wrapper.
What was broken
The mobile profile rating card laid out the rating, percentile, audience label, and help link across the same multi-column grid used at wider sizes, so the rating data did not align as one readable stack.

Root cause
The small-screen breakpoint kept the three-column grid and right-aligned the help link instead of overriding the rating section to a single aligned mobile column.

What was changed
Updated the mobile MemberRatingCard styles to use one grid column, keep the percentile audience label aligned with the rating data, and place the help action at the same left edge.

Any added/updated tests
No tests were added because this is a scoped SCSS layout fix. Ran the existing profile rating tests for the touched area.
What was broken
The compact profile rating card rendered the Rating/Data Scientists labels with the inherited browser font, the Top percentage pill at 13px, and the What is this? link at 11px instead of the Figma typography.

Root cause (if identifiable)
The card SCSS did not explicitly set Roboto on the small rating labels and used outdated font sizes for the percentile pill and help link.

What was changed
Updated the MemberRatingCard module styles so rating labels use Roboto, the Top percentage pill is 14px, and the What is this? link is 12px.

Any added/updated tests
No tests were added because this is a scoped CSS typography adjustment. Existing MemberRatingCard tests were run to confirm the profile rating-card area still passes.
What was broken
The QA follow-up for the redesigned member profile showed the role line under the rating card should collapse after two role labels and show a "+ N more" affordance. The prior ai-ratings implementation displayed up to four roles and used generic "See more" copy.

Root cause
The earlier role renderer used a hard-coded four-role collapsed limit and did not format the hidden role count from the design.

What was changed
Added a documented display-state helper for preferred roles and wired MemberRatingCard to render two collapsed roles with "+ N more", while retaining the existing expanded "See less" behavior and prior trait parsing.

Any added/updated tests
Added MemberRatingCard utility tests for the two-role collapsed state, expanded state, and no-toggle state. Ran the focused profile-card spec, lint, and build. The full yarn test:no-watch command was also run, but it still fails in unrelated work, wallet, and engagement suites outside this change.
PM-5261: Keep rating position details together
PM-5260: Fix rating popup typography
PM-5258: Format award badge tooltips
PM-5257: Align mobile rating card data
PM-5253: Fix rating card typography
PM-5227: tighten profile preferred-role display
What was broken
The compact profile card rendered memberStats.maxRating.rating, which is the historical max rating. For users whose newest rated track had moved below an older max, the card did not match the latest rating shown in the track stats.

Root cause (if identifiable)
The card read the stats API maxRating summary directly instead of deriving the display value from rated track entries.

What was changed
Added a helper that selects the rated track/subtrack with the newest mostRecentEventDate across Development, Design, and Data Science stats, falling back to maxRating only when no rated track entry exists. The card now renders that latest profile rating.

Any added/updated tests
Added unit tests for latest-track selection, configured Data Science rating paths, and maxRating fallback.
PM-5230: Show latest profile rating
What was broken
The Challenge Points profile bar rendered the label at 18px in bold and the points total at 32px, which did not match the required typography.

Root cause (if identifiable)
The earlier Challenge Points implementation inherited oversized bar text and explicitly set the label to bold and the numeric value to 32px.

What was changed
Updated the Challenge Points bar stylesheet so the label renders at 16px with normal weight and the points total renders at 26px.

Any added/updated tests
No tests were added because this is a CSS-only typography adjustment. Existing profile specs were run for the surrounding profile area.
What was broken
The challenge points banner rendered the "View breakdown" chevron too small compared with the adjacent label and profile stats arrows.

Root cause
The breakdown trigger used the shared `icon-sm` class, which renders an 8px icon.

What was changed
Changed the breakdown chevron to use `icon-lg` so it renders at the larger profile action size.

Any added/updated tests
Added a MemberChallengePointsBar regression test that renders a breakdown-capable points bar and asserts the chevron uses `icon-lg` instead of `icon-sm`.
What was broken
The preferred roles under the profile rating card used 16px Roboto styling, inserted a middle-dot separator between role labels, and sat too close to the member title below.

Root cause
The rating-card SCSS rendered preferred roles as wrapping inline items with a pseudo-element separator and reused the older green toggle styling.

What was changed
Updated the preferred role list to use 14px Nunito Sans at 500 weight, render roles as separate centered rows without the separator symbol, style the expand/collapse control with #0D61BF, and add bottom spacing before the profile title.

Any added/updated tests
No test files were changed. Ran the focused MemberRatingCard utility spec, the full non-watch Jest command, lint, and build.
What was broken
The rating comparison popup highlighted the pyramid using rating ranges, so the position graphic could point at the wrong tier for a member's Top %.

Root cause
The modal reused the selected rating tier for both the rating legend and the position pyramid, even though the pyramid should be based on Top % thresholds.

What was changed
Added percentile-bucket selection for the pyramid: top 10% or less, 25% or less, 50% or less, 75% or less, and greater than 75%.
Kept the highlighted segment color aligned with the member's rating color and made the mobile pyramid/position row explicit.

Any added/updated tests
Updated MemberRatingInfoModal tests to assert the position summary and percentile bucket highlighting.
What was broken
The compact profile rating card rendered the lowest rating tier in the shared dark grey, making the rating and Top percentage badge hard to read on the dark AI Ratings card.

Root cause (if identifiable)
MemberRatingCard reused the global rating color directly. The lowest-tier grey works on light backgrounds but has poor contrast against the card's navy background.

What was changed
Added a compact-card rating color helper that maps the lowest rating tier to the lighter grey palette value while preserving the existing shared colors for higher tiers, and used it for the card rating value and Top percentage badge.

Any added/updated tests
Updated MemberRatingCard.utils.spec.ts to cover the low-tier compact color mapping and to verify higher rating tiers keep their shared colors. Focused profile tests, lint, and build were run; the full test command was also run and failed in unrelated work/wallet-admin suites outside the profile rating change.
PM-5277: Fix preferred role styling
PM-5256: Fix challenge points typography
jmgasper and others added 14 commits June 19, 2026 10:17
PM-5397: Show AI Engineering challenge history
PM-5402: Stack high rating marker label
What was broken

The previous PM-5384 fix moved the desktop About Me greeting closer to the profile picture, but QA reported that the result was now a bit too close and needed more breathing room.

Root cause

The prior desktop left-column offset changed from -60px to -140px, which corrected the original oversized gap but slightly overcorrected the spacing under the avatar.

What was changed

Reduced the desktop left profile column offset from -140px to -120px so the greeting sits lower while still remaining much closer to the profile picture than the original layout. Tablet and mobile offsets remain unchanged.

Any added/updated tests

No tests were added because this is a CSS-only spacing adjustment. Validation included lint, production build, a related-test lookup for the changed stylesheet, and the existing profile-area test suite.
PM-5384: Tune profile photo name spacing
What was broken
The prior PM-5402 fix only stacked the rating label after the marker reached 90% of the chart. QA still saw the tourist rating rendered inline and clipped at the right edge.

Root cause
The inline avatar and score need horizontal room to the right of the marker, so a percentage threshold that close to the edge was too conservative. The previous regression test used a shortened distribution that clamped 3664 to the chart end, so it did not cover a high score that sits before the final tenth of the rendered chart.

What was changed
Lowered the right-edge stacking threshold to 80% so high ratings switch to the stacked avatar-over-score layout before the inline badge can run out of space.

Any added/updated tests
Updated the MemberRatingInfoModal regression fixture so the 3664 score is tested against a wider distribution range and still applies the stacked marker layout.
What was broken
The previous PM-5401 fix kept the member stats typography readable for trip-winner layouts, but QA reported that the chevron on the right side of each stats row still did not align consistently.

Root cause
The right-side track details group had a fixed minimum width, but its contents were left-aligned inside that space. Rows without winner or rating icons left unused space after the chevron, so the chevron landed farther left than rows with icons or wider values.

What was changed
Right-aligned the contents of the track details group so each row's chevron sits on the same right edge while preserving the existing row structure and spacing.

Any added/updated tests
Updated the MemberStatsBlock SCSS test to assert that track details are right-aligned for consistent chevron placement.
What was broken
The profile rating percentile tooltip could remain visible after opening the rating information modal and then closing it.

Root cause
The percentile tooltip was uncontrolled and stayed mounted while the rating modal was open, so its hover state could survive the modal overlay lifecycle.

What was changed
Disable the percentile tooltip whenever the rating information modal is open, which unmounts the tooltip until the modal closes.

Any added/updated tests
Updated MemberRatingCard tests to assert the percentile tooltip is disabled while the rating modal is open and restored after closing.

Validation:
- yarn test:no-watch src/apps/profiles/src/member-profile/about-me/MemberRatingCard/MemberRatingCard.spec.tsx
- yarn lint
- yarn run build
- yarn test:no-watch (attempted; existing unrelated failures in work, engagements, and wallet-admin specs)
What was broken
Registration and submission phase start date fields stayed editable after those phases had completed.

Root cause
The schedule start-date editability helper only checked phase type and sequencing rules. It did not apply the existing completed-phase lock condition used by end date and duration fields.

What was changed
Closed phases with an actual end date are no longer considered start-date editable, so completed registration and submission rows render disabled.

Any added/updated tests
Updated ChallengeScheduleSection component coverage for completed registration locking and added helper coverage for completed submission start-date locking.
PM-5406: Close rating tooltip with info modal
PM-5401: Align member stats chevrons
PM-5402: Stack high rating marker sooner
PM-5412: Disable closed phase start dates
@jmgasper jmgasper requested a review from kkartunov as a code owner June 22, 2026 06:01
jmgasper added 11 commits June 22, 2026 16:16
What was broken
Work schedule edits could shorten unchanged phases by recalculating their end dates from stale rounded durations. Active non-Design phases also lost their original end-date floor after an extension, future active phases were not consistently protected, and completed phase rows did not display actual close times.

Root cause
The schedule editor treated duration-derived template values as authoritative during recalculation and based active-phase minimum dates on mutable row state instead of the persisted phase end date captured when edit mode opened.

What was changed
Preserved existing phase end dates when the phase start is unchanged, reconciled duration from the preserved start/end pair, tracked persisted end dates for active minimum validation, applied active challenge rules to incomplete future phases, and displayed completed phases using actual start/end dates without mutating form values.

Any added/updated tests
Added Work schedule helper and component coverage for preserving unchanged end dates, displaying actual completed phase dates, stable non-Design minimum end dates after extension, and future active non-Design phase minimum validation. Updated ChallengeScheduleSection documentation.
What was broken
The prior PM-5401 fixes kept the trip-winner member stats text readable and right-aligned the details group, but rows could still derive the right-side layout from different child combinations. Rows with optional winner or rating icons and rows without icons did not reserve the same internal columns for the icon, stat value, and chevron.

Root cause
The member stats row used a flex details group with optional icon children. Even with right-aligned contents, the stat/icon/chevron spacing still depended on which optional indicator rendered in that row.

What was changed
Changed the track details group to a small CSS grid with reserved indicator, stat, and chevron columns at both normal and compact widths. The chevron now sits in a dedicated rightmost column regardless of optional icon presence, while the earlier typography breakpoint fix remains intact.

Any added/updated tests
Updated the MemberStatsBlock SCSS regression test to assert that the details area reserves grid columns for the icon, stats, and chevron alignment.
PM-5378: Stabilize Work phase schedule edits
What was broken
The previous follow-up still depended on the marker reaching a chart-position threshold before stacking the avatar and score. The regression test only covered a clamped right-edge case, so it did not prove that a 3664-style rating would stack when a wider distribution tail placed the marker before that threshold.

Root cause
The inline marker layout can still run out of horizontal room for extreme ratings when the distribution range or viewport leaves less usable space than the threshold assumes.

What was changed
Stack marker labels for extreme ratings in addition to the existing right-edge position threshold, keeping high scores below the avatar before the inline badge can crowd the chart edge.

Any added/updated tests
Updated the MemberRatingInfoModal regression test with an expanded-tail distribution that places rating 3664 before the 80% threshold and verifies the stacked marker layout still applies.
What was broken
AI Engineering and Data Science subtrack summary cards could show 0 submissions, and AI Engineering detail headers could show 0 wins, even when the profile history showed challenge activity and winning placements.

Root cause
The profiles UI rendered aggregate counters directly from member stats rows. Some unified stats rows expose challenge/rating history while their aggregate win or submission counters are missing or left at zero.

What was changed
Added a shared subtrack summary helper that preserves positive aggregate counters, falls back to history placement wins when aggregate wins are zero, and falls back to history/challenge counts when submission counters are zero. Track and subtrack views now use that helper for cards and detail summaries.

Any added/updated tests
Updated useFetchActiveTracks specs to cover zero-submission fallback and AI Engineering history-derived wins/submissions.
What was broken
Preferred roles lived inside the profile rating card, and the entire card was hidden when the stats API did not return a usable rating.

Root cause (if identifiable)
MemberRatingCard returned an empty fragment whenever getProfileRating(memberStats) was undefined, so both saved roles and the owner edit action were skipped for unrated members.

What was changed
Decoupled card visibility from rating availability. The rating summary still renders only when a rating exists, while the preferred roles list and owner edit action render independently.

Any added/updated tests
Updated MemberRatingCard specs to cover saved preferred roles and the owner edit action when rating data is unavailable.
PM-5407: Show preferred roles without rating
PM-5433: Fix profile subtrack summary counters
PM-5401: Reserve member stats chevron column
PM-5402: Stack extreme rating markers
@jmgasper jmgasper changed the title AI Ratings PROD - AI Ratings Jun 22, 2026
@jmgasper jmgasper merged commit 0b79df9 into master Jun 23, 2026
9 checks passed
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.

2 participants