feat(dashboard): add panel-level Suspense boundaries for independent loading (#94)#149
feat(dashboard): add panel-level Suspense boundaries for independent loading (#94)#149Sujini-kudupudi wants to merge 2 commits into
Conversation
|
@Sujini-kudupudi is attempting to deploy a commit to the codersogs-3057's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Please see this #67 (comment) |
Siddhartha-singh01
left a comment
There was a problem hiding this comment.
The Suspense refactor itself is exactly the right pattern for #94 @Sujini-kudupudi
extracting each slow panel into its own Server Component with a <Suspense> boundary
and a skeleton fallback is the textbook App Router approach, and the page shell going
from ~458 to 117 lines is a real win. The skeleton fallbacks per panel will make the
perceived performance much better than the previous "wait for the slowest query"
behavior.
Two things to sort before merge:
-
Scope bleed-in from PR #124. Your commit list includes 4 commits from #124 (the
recommendations server-actions tests), andrecommendations.test.ts(+391 lines)
is in this PR's diff. Cleanest path: wait for #124 to merge first, then rebase this
PR on main the test commits will drop out of this diff automatically, leaving
only the dashboard refactor. Otherwise the PR is doing two unrelated things and
#124 becomes redundant. -
profile: anyin stats-row.tsx. Ironically, one of the commits in this PR
(27fd784) is theany → unknowncleanup. The new StatsRow acceptsprofile: any
please give it a proper type matching the fields fetched in page.tsx
(github_handle, xp, level, github_total_merges, github_streak, github_stats_synced_at).
Minor: a screenshot or short clip of the staggered panel loading would help reviewers
verify the UX without running locally the description says "N/A" but this is
exactly the kind of change where visual confirmation matters.
I checked page.tsx carefully for any merge corruption (lessons learned from #151
😅) and it parses cleanly structure is intact.
Once #124 lands and you've rebased + fixed the profile: any, and CI goes green,
this is ready to merge. Solid refactor overall
Thanks!
|
can you please check the failing tests ? |
|
9469d2e to
c009443
Compare
|
Thanks for the review Siddhartha! I have completely rebased the branch onto main to drop the extra commits, fixed the any typing to match the DB fields, and resolved the CI formatting issues. All checks are passing now! Here is a quick video showing the new staggered Suspense loading in action as requested screen-recording-2026-05-23-003936_kfEn2iEY.mp4 |
Summary
This PR implements panel-level
<Suspense>boundaries across the contributor dashboard. Previously, the dashboard executed 5+ parallel queries inside a single, page-level Server Component. Because Next.js Server Components block rendering until all awaited promises resolve, a slow fetch (such as recommendations, leaderboard query, or Redis streak check) would delay the entire page load, leaving users with a blank screen.By extracting each panel into its own async Server Component and wrapping them in independent
<Suspense>boundaries, the page shell and header render instantly, and each dashboard panel renders dynamically as soon as its own data is ready.Type of Change
Related Issue
Closes #94
What was changed?
stats-row.tsx): Created a new async server component to handle Redis caches, level progress, and mentor points queries independently. Defined the customStatsSkeletonfallback.active-issues.tsx): Created a new async server component to fetch recommendations asynchronously. Defined the customRecsSkeletonfallback (showing 2 animated issue card loaders).github-prs-wrapper.tsx): Created a new async server component to fetch contributor PRs and matching claimed recommendation URLs. Defined thePrsSkeletonfallback.leaderboard-snapshot.tsx): Created a new async server component to load global contributor rankings, incorporating the updated empty-board message from upstream. Defined theLeaderboardSkeletonfallback.mentees-section.tsx): Created a new async server component to fetch active help requests assigned to the mentor. Defined theMenteesSkeletonfallback.page.tsx): SimplifiedDashboardPageto perform fast session checks and the basic profile lookup. All sub-panels are now nested within individual<Suspense>containers with beautiful, theme-matching skeleton fallbacks.Screenshots
N/A (UI layouts and colors are fully preserved, now enhanced with beautiful animated pulse skeleton loaders for independent loading).
Checklist
npm run dev)