-
-
Notifications
You must be signed in to change notification settings - Fork 70
Fix missing usernames on Code Golf leaderboard #1610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix missing usernames on Code Golf leaderboard #1610
Conversation
…f padding between username & answer preview
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, tested locally and made a couple of improvements on top:
- Added some JSDoc for type checking in TS-aware IDEs (barebones, feel free to expand upon);
- Ensured
getLeaderboard
doesn't cause a runtime error ifheader
is not found in some of the entries; - Added a bit of padding to the right of the now restrored usernames;
I apologize. I made the change that caused this and it never occurred to me that there was a dependency in the leaderboard. |
@cellio that's fine, the issue is more that we neither provide a hook there for scripts to use (in other places, we mark elements that are used by our JS assets with classes prefixed with |
@cellio echoing @Oaphi there's nothing to apologise for. Every change is seen by at least 2 people (commiter and reviewer) and I wouldn't expect either of them to spot something that no amount of manual testing can find without going through every existing community (please don't start doing that!). I've raised #1609 to discuss ways of automatically testing the communities that have custom JS. On top of that, as pointed out, once we have an API this sensitivity of the leaderboard to HTML changes will go away. And if you insist on apologising, then I'm sorry too - I both requested the change and looked over the pull request before it was merged and I didn't spot this either. |
@Oaphi thanks for the extra improvements - those all look good too. Does this mean we need a third person to review now...? |
No need to, I've merged the PR - a cross-review we've done is enough in this case, imo |
Fixes Missing usernames on leaderboard which I've only just posted - it doesn't have a GitHub issue yet.
We recently made the user avatar in the user card under a post into a link to the user profile page. This means there are now 2 elements with the class
.user-card--link
per user card, and the leaderboard code was trying to find a username in the avatar instead of the text link.This pull request makes the selector more specific to avoid this problem.
I'm not on my development machine so I've only tested this in the browser developer window on the live site, not in development. Making a pull request now to remind me to test this when I can, and to allow anyone else to test if you wish.