fix: resolve ui issues and bugs from manage-events, url-shortner, campus dashboard and implement new karma distribution#338
Conversation
…for improved readability and maintainability
…g; update CampusManageDashboard and InterestGroupDetailClient to use new icons
…en for improved chart aesthetics
👷 Deploy request for staging-mulearn pending review.Visit the deploys page to approve it
|
|
@alvin-dennis is attempting to deploy a commit to the awindsr's projects Team on Vercel. A member of the Team first needs to authorize it. |
Greptile SummaryThis PR fixes a batch of UI bugs and adds the new karma distribution donut chart across manage-events, URL shortener, campus dashboard, and profile pages.
|
| Filename | Overview |
|---|---|
| src/components/ui/image-upload.tsx | Removes the destructive 'Remove image' button; handleRemove is now unreachable dead code. |
| src/features/profile/components/karma-distribution.tsx | Complete rewrite to a donut PieChart using ResponsiveContainer correctly; desktop-only hover interaction guarded cleanly via useIsDesktop hook; new API split fields consumed directly. |
| src/features/profile/schemas/profile.schema.ts | Adds four new Zod schemas for karma split fields with safe .default() values; types inferred from schemas per project conventions. |
| src/features/interest-groups/components/interest-group-detail-client.tsx | IGIcon helper now defined at module scope (correct); IG Lead edit dialog removed; previously flagged dead iconError/setIconError state is also gone. |
| src/features/campus-manage/components/campus-manage-dashboard.tsx | ChapterIcon added at module scope with error fallback; student names now link to profile pages; rank column removed from leaderboard columns. |
| src/features/url-shortener/components/browser-breakdown.tsx | Replaces recharts Legend with a custom scrollable legend grid; tooltip still covers per-segment values on hover. |
| src/features/url-shortener/components/country-breakdown.tsx | Mirror of browser-breakdown changes; same scrollable legend without per-entry value display. |
| src/features/events/schemas/events.schema.ts | Adds .max(5000) to description and .max(30) per tag, matching the new HTML maxLength attributes in the form. |
| src/features/profile/utils/karma.utils.ts | Deleted alongside its test suite; logic moved inline into karma-distribution.tsx useMemo; edge cases previously covered by tests are now untested. |
| src/features/projects/components/project-wizard.tsx | Centralises file validation through validateImageFile from lib/constants/upload; user-facing labels improved. |
| src/features/manage-ig/components/ig-form-dialog.tsx | Adds a live icon URL preview that degrades gracefully on load error; erroredIconUrl tracks per-URL failures correctly. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
API["Django API\n(UserProfile response)"] --> Schema["profile.schema.ts\norg_ig_karma_split\nevent_karma_split\nintern_karma\ngeneral_enablement_karma"]
Schema --> Hook["useProfile hook\n(TanStack Query)"]
Hook --> BD["BasicDetails"]
BD --> KD["KarmaDistribution\n(donut PieChart)"]
KD --> CM["useMemo\nbuild chartData slices\nfilter zero-value\nsort descending\ndeduplicate IDs"]
CM --> RC["ResponsiveContainer\n→ PieChart → Pie → Cell[]"]
CM --> Legend["Legend ul\n(scrollable on mobile)"]
RC --> Hover["useIsDesktop\ndesktop hover → activeIndex\nmobile: static"]
Hover --> Center["Donut center\nactive: name + %\ndefault: total karma"]
Reviews (7): Last reviewed commit: "fix(event-calendar-card): replace Link c..." | Re-trigger Greptile
…r handling and readability
…ity for cleaner component
… in campus manage and event calendar
No description provided.