feat(profile): load Codeforces avatar and introduce reusable EmptyStateView#14
feat(profile): load Codeforces avatar and introduce reusable EmptyStateView#14mvanhorn wants to merge 1 commit into
Conversation
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
✨ 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. Review rate limit: 0/1 reviews remaining, refill in 59 minutes and 51 seconds.Comment |
|
Heads up: I didn't run this on a Simulator locally. No new tests in this one (EmptyStateView is a pure-View struct), so manual QA on Profile avatar load + the four empty-state screens is on you before merge. If anything looks off in the build, ping me and I'll iterate. |
Description
Two related UI improvements bundled per issue #9.
Part A. Profile screen now loads the user's actual Codeforces avatar via SDWebImageSwiftUI's
WebImageinstead of the SF Symbol placeholder. Protocol-relative URLs from the API (//userpic.codeforces.org/...) are normalized by prependinghttps:. The originalperson.fillsymbol remains as the placeholder for nil URLs and load failures, with the same circular shape, gradient border, and neon shadow.Part B. New reusable
CForge/Views/Common/EmptyStateView.swiftstandardizes empty, error, and loading states acrossContestListView,ProblemListView,ProfileView, andProblemSubmissionsView. Switching offContentUnavailableViewinProblemSubmissionsViewalso lifts the iOS 17+ floor for that screen.Happy to split this into two PRs (avatar first, sweep second) if you'd prefer smaller review units. Let me know.
Related Issue
Closes #9
Changes Made
ProfileModels.swift: addavatar: String?andtitlePhoto: String?toCodeforcesUser.ProfileView.swift: replace the SF Symbol inprofileHeader(user:)withWebImage(url: normalizeAvatarURL(user.titlePhoto ?? user.avatar))and aperson.fillplaceholder. AddnormalizeAvatarURL(_:)helper for protocol-relative URLs. Replace the raw red error text withEmptyStateView.Views/Common/EmptyStateView.swift: configurable icon, title, optional subtitle, optional action button. Neon-themed.ContestListView.swift: replace bareProgressView()initial-load placeholder withEmptyStateView(loading variant). Keeps the existing.onAppeartrigger.ProblemListView.swift: replace the inline error VStack withEmptyStateView.ProblemSubmissionsView.swift: replace threeContentUnavailableViewcalls (signed-out, error, no-attempts) withEmptyStateView.Screenshots (if UI changes)
Will add before / after pairs for the Profile avatar and one or two empty states before review.
Checklist
Cmd+B)