fix(ui): standardize action button sizes (#1440)#2199
Conversation
|
@VIDYANKSHINI 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. |
GSSoC Label Checklist 🏷️@Priyanshu-byte-coder — please apply the appropriate labels before merging: Difficulty (pick one):
Quality (optional):
Validation (required to score):
|
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR standardizes button styling across the UI by adopting the shared Button component / buttonVariants utility and updates the base button design tokens (radius, typography, focus rings, transitions).
Changes:
- Updated base button variant styles (radius, font weight, focus ring, sizing, and variant-specific classes).
- Replaced bespoke
<button>styling in multiple components with the sharedButtoncomponent. - Replaced bespoke link/button styles with
buttonVariants()where a real button component isn’t used.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/components/ui/button.tsx | Updates global button styling and variant/size class definitions. |
| src/components/repo-analytics/RepoCard.tsx | Uses buttonVariants for link styling and Button for actions. |
| src/components/SignOutButton.tsx | Replaces custom sign-out buttons with shared Button variants. |
| src/components/GoalTracker.tsx | Replaces multiple custom buttons (sync, +1, delete, copy link, submit) with Button. |
| src/components/DashboardHeader.tsx | Uses buttonVariants for links and Button for mobile menu toggle. |
| src/components/ConfirmModal.tsx | Converts modal actions to shared Button variants. |
| src/app/dashboard/page.tsx | Normalizes the first import line (likely removes stray BOM/formatting). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| const buttonVariants = cva( | ||
| "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--ring)] disabled:pointer-events-none disabled:opacity-50", | ||
| "inline-flex items-center justify-center whitespace-nowrap rounded-xl text-sm font-semibold transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--accent)] disabled:pointer-events-none disabled:opacity-50 gap-2 active:scale-[0.98]", |
|
|
||
| const buttonVariants = cva( | ||
| "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--ring)] disabled:pointer-events-none disabled:opacity-50", | ||
| "inline-flex items-center justify-center whitespace-nowrap rounded-xl text-sm font-semibold transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--accent)] disabled:pointer-events-none disabled:opacity-50 gap-2 active:scale-[0.98]", |
| "bg-[var(--accent)] text-[var(--accent-foreground)] shadow hover:opacity-90", | ||
| destructive: | ||
| "bg-[var(--destructive)] text-white shadow-sm hover:opacity-90", | ||
| "border border-[var(--destructive)]/50 bg-[var(--destructive)]/80 text-[var(--foreground)] shadow hover:bg-[var(--destructive)]", |
| <Button | ||
| variant="ghost" | ||
| size="icon" | ||
| onClick={() => setConfirmingId(goal.id)} | ||
| disabled={isDeleting} | ||
| className="text-[var(--muted-foreground)] hover:text-[var(--destructive)] transition-colors disabled:opacity-50" | ||
| aria-label={`Delete goal: ${goal.title}`} | ||
| title="Delete goal" | ||
| > | ||
| <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" className="w-4 h-4" aria-hidden="true"> | ||
| <path fillRule="evenodd" d="M8.75 1A2.75 2.75 0 006 3.75v.443c-.795.077-1.584.176-2.365.298a.75.75 0 10.23 1.482l.149-.022.841 10.518A2.75 2.75 0 007.596 19h4.807a2.75 2.75 0 002.742-2.53l.841-10.52.149.023a.75.75 0 00.23-1.482A41.03 41.03 0 0014 4.193V3.75A2.75 2.75 0 0011.25 1h-2.5zM10 4c.84 0 1.673.025 2.5.075V3.75c0-.69-.56-1.25-1.25-1.25h-2.5c-.69 0-1.25.56-1.25 1.25v.325C8.327 4.025 9.16 4 10 4zM8.58 7.72a.75.75 0 00-1.5.06l.3 7.5a.75.75 0 101.5-.06l-.3-7.5zm4.34.06a.75.75 0 10-1.5-.06l-.3 7.5a.75.75 0 101.5.06l.3-7.5z" clipRule="evenodd" /> | ||
| </svg> | ||
| </button> | ||
| </Button> |
Summary
Standardized action button sizes and styles across the dashboard to resolve visual alignment jitter and inconsistent padding/heights.
Closes #1440
Type of Change
Changes Made
Buttoncomponent (src/components/ui/button.tsx) to explicitly use ah-10default height,rounded-xlborder radius, and unified styling.DashboardHeader.tsxto use the standardButtonvariants for the share profile link and mobile menu toggle.GoalTracker.tsx(refresh, "+1", trash, and submit buttons) with standard semanticButtoncomponents.ConfirmModal.tsxandSignOutButton.tsx.RepoCard.tsxto use uniform padding and heights.How to Test
Steps for the reviewer to verify this works:
GoalTrackerwidget and verify the "+1", delete, refresh, and submit buttons have consistent heights and hover states.ConfirmModal(e.g., attempt to delete a goal) or trigger theSignOutButtonto ensure the modal action buttons are aligned and styled consistently.RepoCardbuttons have uniform padding.Screenshots (if UI change)
Checklist
npm run lintpasses locallynpm run type-check)Accessibility Checklist
Taband show focus rings)aria-labelused correctly on icon buttons)Additional Notes
By centralizing the action buttons around the core UI
Buttoncomponent, future additions to the dashboard should automatically inherit the correct spacing, sizing, and premium visual aesthetic.