Skip to content

refactor: extract reusable ui primitives and standardize dashboard components#1559

Open
ArshVermaGit wants to merge 8 commits into
Priyanshu-byte-coder:mainfrom
ArshVermaGit:main_10
Open

refactor: extract reusable ui primitives and standardize dashboard components#1559
ArshVermaGit wants to merge 8 commits into
Priyanshu-byte-coder:mainfrom
ArshVermaGit:main_10

Conversation

@ArshVermaGit
Copy link
Copy Markdown
Contributor

Overview

This PR addresses significant markup bloat across our src/components/ directory. By extracting common structural elements (Buttons, Cards, Badges, Skeletons) into centralized, reusable primitives, we drastically reduce inline Tailwind CSS duplication. This makes future design changes vastly easier to maintain globally and significantly improves component readability.

Resolved Issue

Resolves #1558

Changes Made

  • Tooling Integration: Added clsx, tailwind-merge, and class-variance-authority to power dynamic and conflict-free class resolution in a new cn() utility function (src/lib/utils.ts).
  • Standard Primitives: Created foundational UI components located in src/components/ui/:
    • <Button />: Standardized semantic variants (default, outline, ghost, destructive) and sizing (sm, lg, icon).
    • <Card /> Group: Abstracted the standard dashboard container styling (rounded-xl border bg-[var(--card)] p-6).
    • <Badge />: Centralized metric flag styling (success, destructive, outline, etc.).
    • <Skeleton />: Centralized the shimmer loader component.
  • Component Refactoring: Modernized three highly visible dashboard components to utilize the new primitives:
    • ProjectMetrics.tsx
    • CodingActivityInsightsCard.tsx
    • WeeklySummaryCard.tsx

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • UI/UX Improvement
  • Code Refactoring / Technical Debt Reduction

How Has This Been Tested?

  • Verified zero layout jumping or padding changes on the refactored components; they visually match the previous implementation exactly.
  • Verified interactive elements (Refresh, Connect Jira, Collapse buttons) function correctly when wrapped in the new <Button> component.
  • Ran npm run build and verified the project compiles successfully with no missing module or type errors.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

@ArshVermaGit is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added gssoc26 GSSoC 2026 contribution type:design GSSoC type bonus: UI/design (+10 pts) type:refactor GSSoC type bonus: refactor (+10 pts) labels May 29, 2026
@github-actions
Copy link
Copy Markdown

GSSoC Label Checklist 🏷️

@Priyanshu-byte-coder — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

Copy link
Copy Markdown
Contributor Author

@ArshVermaGit ArshVermaGit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Priyanshu-byte-coder ! Issue #1558 has been resolved. Please review the PR and merge it under GSSoC. Thanks!

@Priyanshu-byte-coder Priyanshu-byte-coder added gssoc:approved GSSoC: PR approved for scoring level3 GSSoC Level 3 - Advanced (45 points) labels May 30, 2026
Copy link
Copy Markdown
Owner

@Priyanshu-byte-coder Priyanshu-byte-coder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR now has merge conflicts with main due to recent merges. Please rebase onto the latest main branch and resolve conflicts before we can merge.

@Priyanshu-byte-coder
Copy link
Copy Markdown
Owner

This PR now has merge conflicts with main. Please rebase your branch against the latest main and force-push to resolve. Run: git fetch upstream && git rebase upstream/main

@github-actions github-actions Bot added the type:devops GSSoC type bonus: devops (+15 pts) label May 31, 2026
@ArshVermaGit
Copy link
Copy Markdown
Contributor Author

@Priyanshu-byte-coder merge conflicts are resolved please review and merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved GSSoC: PR approved for scoring gssoc26 GSSoC 2026 contribution level3 GSSoC Level 3 - Advanced (45 points) type:design GSSoC type bonus: UI/design (+10 pts) type:devops GSSoC type bonus: devops (+15 pts) type:refactor GSSoC type bonus: refactor (+10 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] [Code Quality] Extract Reusable UI Components (Button, Card, Badge)

2 participants