Skip to content

fix: resolve ui issues and bugs from manage-events, url-shortner, campus dashboard and implement new karma distribution#338

Merged
awindsr merged 12 commits into
gtech-mulearn:devfrom
alvin-dennis:fix/campus
Jul 24, 2026
Merged

fix: resolve ui issues and bugs from manage-events, url-shortner, campus dashboard and implement new karma distribution#338
awindsr merged 12 commits into
gtech-mulearn:devfrom
alvin-dennis:fix/campus

Conversation

@alvin-dennis

Copy link
Copy Markdown
Contributor

No description provided.

@netlify

netlify Bot commented Jul 23, 2026

Copy link
Copy Markdown

👷 Deploy request for staging-mulearn pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 29c49a9

@vercel

vercel Bot commented Jul 23, 2026

Copy link
Copy Markdown

@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.

@alvin-dennis alvin-dennis changed the title fix: resolve ui issues and bugs from manage-events, url-shortner- and implement new karma distribution fix: resolve ui issues and bugs from manage-events, url-shortner, campus dashboard and implement new karma distribution Jul 23, 2026
@greptile-apps

greptile-apps Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This 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.

  • Karma distribution rewrite: karma-distribution.tsx is replaced with a donut PieChart (using ResponsiveContainer correctly) backed by four new API split fields (org_ig_karma_split, event_karma_split, intern_karma, general_enablement_karma) added to UserProfileSchema with safe Zod defaults. The previous karma.utils.ts helper and its test suite are deleted as the logic now lives inline.
  • Icon previews: ChapterIcon (campus dashboard) and IGIcon (IG detail) are both added at module scope with URL validation and error-fallback patterns; ig-form-dialog.tsx gains a live icon URL preview with per-URL error tracking.
  • URL shortener charts: recharts Legend replaced with a custom scrollable legend grid in both browser-breakdown.tsx and country-breakdown.tsx; event/tag max-length constraints added to schemas and UI inputs.
  • Image upload: the "Remove image" button is removed from ImageUpload, leaving handleRemove as unreachable dead code and removing the ability to clear a selection.

Confidence Score: 5/5

Safe to merge; the karma distribution rewrite is well-structured, icon error handling is correct, and schema additions use safe Zod defaults throughout.

All the meaningful architectural changes (ResponsiveContainer usage, IGIcon/ChapterIcon at module scope, schema field additions with defaults) are implemented correctly. The one dead-code artifact — handleRemove never being called after its button was removed — is a cleanup item that does not break any runtime path.

src/components/ui/image-upload.tsx — the handleRemove function is now unreachable and the ability to clear an uploaded image is gone.

Important Files Changed

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"]
Loading

Reviews (7): Last reviewed commit: "fix(event-calendar-card): replace Link c..." | Re-trigger Greptile

Comment thread src/features/profile/components/karma-distribution.tsx Outdated
Comment thread src/features/interest-groups/components/interest-group-detail-client.tsx Outdated
Comment thread src/features/interest-groups/components/interest-group-detail-client.tsx Outdated
Comment thread src/features/home/components/event-calendar-card.tsx
@alvin-dennis alvin-dennis moved this from Backlog to In progress in µlearn 5.0 Jul 24, 2026
@awindsr
awindsr merged commit 01dca7f into gtech-mulearn:dev Jul 24, 2026
4 of 7 checks passed
@github-project-automation github-project-automation Bot moved this from In progress to Integration Testing in µlearn 5.0 Jul 24, 2026
@alvin-dennis
alvin-dennis deleted the fix/campus branch July 24, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Integration Testing

Development

Successfully merging this pull request may close these issues.

2 participants