Fix layout overflow, card containment, and hook ordering issues#339
Conversation
- Fix React Rules of Hooks error in intern leaderboard client by calling hooks at top-level - Fix horizontal layout overflow on event detail page with grid min-w-0 containment - Enclose event detail cards inside parent background container - Fix layout alignment on public profile page
|
@erzer12 is attempting to deploy a commit to the awindsr's projects Team on Vercel. A member of the Team first needs to authorize it. |
👷 Deploy request for staging-mulearn pending review.Visit the deploys page to approve it
|
|
@alvin-dennis eda njn intern leaderboard il changed top 3 to be like that in the normal leaderboard |
Greptile SummaryThis PR addresses layout overflow/horizontal-scroll regressions across the event detail, public profile, and own-profile pages, and ships a complete podium redesign for the intern leaderboard with a new inline
|
| Filename | Overview |
|---|---|
| src/app/(dashboard)/dashboard/intern/leaderboard/intern-leaderboard-client.tsx | Major podium redesign: new Medal SVG component, getPodiumUser now correctly returns null for empty slots, and useMemo added for leaderboardIdentity. One non-standard Tailwind class (scale-120) in the rank-1 glow blur element. |
| src/app/(dashboard)/dashboard/profile/profile-client.tsx | DOM order fix: sidebar div moved from first-in-DOM (visually second via lg:order-2) to last-in-DOM; on mobile tabs now correctly appear above sidebar. Clean change. |
| src/app/(dashboard)/profile/[muid]/publicprofile-client.tsx | Achievements component wired up with correct props (muid, userName, isOwnProfile), replacing the placeholder. Layout/overflow wrappers added; sidebar is already last in DOM so mobile order is correct. |
| src/features/events/components/event-detail-view.tsx | Fragment replaced with a conditional-return pattern; non-full layouts now return innerContent directly (no extra div), fixing the previous empty-div regression. Overflow and min-width fixes added. |
| src/features/events/components/event-about-section.tsx | Minor: adds break-words class to prevent long descriptions from causing horizontal overflow. Clean one-line change. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
subgraph LeaderboardClient["LeaderboardPageClient"]
H[Hooks: useState, useMemo, useLeaderboard x2] --> P["getPodiumUser(0/1/2) → null | user"]
P --> LG{"isPodiumLoading or isBoardLoading?"}
LG -- Yes --> SP[Spinner]
LG -- No --> RC["renderPodiumCard(top1/2/3, rank)"]
RC --> LN{"user.link?"}
LN -- Yes --> LK["Link href={user.link}"]
LN -- No --> DV["div wrapper"]
RC --> TABLE["listRows → Table + Pagination"]
end
subgraph PublicProfile["PublicProfilePageClient"]
PP[usePublicProfile, usePublicUserLog] --> TAB{activeTab}
TAB -- achievements --> ACH["Achievements muid, userName, isOwnProfile"]
TAB -- badges --> BDG["Badges"]
TAB -- others --> OTH["BasicDetails / KarmaHistory / MuVoyage"]
end
subgraph EventDetail["EventDetailView"]
EV["innerContent (always built)"] --> FL{"layout === full?"}
FL -- Yes --> WRP["div overflow-x-hidden wrapper"]
FL -- No --> BARE["return innerContent directly"]
end
Reviews (4): Last reviewed commit: "fix(intern-leaderboard): add accessibili..." | Re-trigger Greptile
… view wrapper and lint changes - Fix mobile layout regression on profile pages by placing main content before sidebar in DOM order - Avoid rendering extra div wrapper in event-detail-view when layout is not full
…SVGs and lint fix - Mark decorative background topo SVGs with aria-hidden="true" to remove them from screen reader tree
|
Screenshots please |








This pull request introduces several improvements to the intern leaderboard and public profile pages, focusing on enhanced UI/UX, code maintainability, and feature completeness. The main changes include a complete redesign of the leaderboard podium section with new medal visuals, improved linking and navigation, and the integration of the Achievements feature into the public profile page. Additionally, there are multiple layout and overflow handling improvements across event and profile components to ensure better responsiveness and prevent horizontal scrolling issues.
Leaderboard Podium Redesign and Feature Enhancements:
Medalcomponent with SVG gradients for the top 3 ranks, and updated the podium UI to use this component for a more visually appealing leaderboard. Podium cards are now clickable and link to user profiles if available. (src/app/(dashboard)/dashboard/intern/leaderboard/intern-leaderboard-client.tsx) [1] [2]useMemofor identity objects and improved data mapping for user cards. (src/app/(dashboard)/dashboard/intern/leaderboard/intern-leaderboard-client.tsx) [1] [2] [3]Profile Page Feature Integration and Layout Improvements:
Achievementscomponent into the public profile page, replacing the placeholder message and ensuring achievements are displayed when the tab is selected. (src/app/(dashboard)/profile/[muid]/publicprofile-client.tsx) (src/app/(dashboard)/profile/[muid]/publicprofile-client.tsxR15, src/app/(dashboard)/profile/[muid]/publicprofile-client.tsxL151-R165)src/app/(dashboard)/profile/[muid]/publicprofile-client.tsx) (src/app/(dashboard)/profile/[muid]/publicprofile-client.tsxL118-R141, src/app/(dashboard)/profile/[muid]/publicprofile-client.tsxL171-L175)Event Page Responsiveness and Readability:
overflow-x-hidden,break-words, and related classes to prevent horizontal scrolling and improve text wrapping, especially for long event descriptions. (src/features/events/components/event-detail-view.tsx,src/features/events/components/event-about-section.tsx) [1] [2] [3]These changes collectively improve the user experience, maintainability, and visual appeal of the application.