Skip to content

Buttons: Updates the primary button style to fit the UI style better #1828

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 27, 2025

Conversation

samejr
Copy link
Member

@samejr samejr commented Mar 27, 2025

  • Updates the primary button colour to indigo
  • Allows all button text to be the same colour across all buttons
  • Fixes the secondary button hover state
  • Updates the Pause Queue button variant on the queue page
  • Makes some of the blank state buttons primary again

CleanShot 2025-03-27 at 12 04 45
CleanShot 2025-03-27 at 12 06 12

Summary by CodeRabbit

  • Style

    • Updated button appearances for improved visual consistency, including enhanced variants and icon treatments for loading states and pause/resume actions.
  • Chores

    • Expanded the color palette with an additional shade to support a more refined design.

Copy link

changeset-bot bot commented Mar 27, 2025

⚠️ No Changeset found

Latest commit: 26267c3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

coderabbitai bot commented Mar 27, 2025

Walkthrough

This pull request updates several UI components for consistent styling and behavior. The modifications include adjustments to button variants and icon properties in different components and routes, as well as updates to the theme configuration in Tailwind. Changes focus on color schemes, border styles, and visual elements without altering public interfaces or underlying logic.

Changes

File(s) Change Summary
apps/.../components/BlankStatePanels.tsx Changed LinkButton variant from "secondary/small" to "primary/small" and removed the LeadingIcon (previously set to PlusIcon) in the TestHasNoTasks and QueuesHasNoTasks functions.
apps/.../components/primitives/Buttons.tsx Updated the theme object: For primary, revised text, button, shortcut, and icon classes; for secondary, adjusted border and hover classes.
apps/.../routes/_app.orgs.../queues/route.tsx
apps/.../routes/storybook.buttons/route.tsx
In queues route, updated EnvironmentPauseResumeButton variant from tertiary/small to secondary/small and removed the side prop from TooltipContent. In storybook route, replaced Spinner props for button LeadingIcon and updated icon usage (switched from GitHubDarkIcon to GitHubLightIcon) and label color classes.
apps/webapp/tailwind.config.js Added a new color entry (550: "#4D525B") to the charcoal palette.

Possibly related PRs

Suggested reviewers

  • matt-aitken
  • ericallam

Poem

Hop, hop, I’m a coding bunny,
Tweaking buttons sweet as honey.
New colors shine, icons refined,
Style and function neatly aligned.
Code hops forward, crisp and sunny—
A burrow of updates, oh so funny! 🐇


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0e82698 and 26267c3.

📒 Files selected for processing (5)
  • apps/webapp/app/components/BlankStatePanels.tsx (2 hunks)
  • apps/webapp/app/components/primitives/Buttons.tsx (1 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.queues/route.tsx (2 hunks)
  • apps/webapp/app/routes/storybook.buttons/route.tsx (6 hunks)
  • apps/webapp/tailwind.config.js (1 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
apps/webapp/app/routes/storybook.buttons/route.tsx (1)
apps/webapp/app/components/primitives/Buttons.tsx (1)
  • Button (291-324)
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
  • GitHub Check: typecheck / typecheck
  • GitHub Check: units / 🧪 Unit Tests
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (13)
apps/webapp/tailwind.config.js (1)

64-64: Enhancement to the charcoal color palette

Adding this intermediate shade 550 of charcoal (#4D525B) between the existing 500 and 600 values provides more granular control for UI elements, particularly useful for border styling in secondary buttons as mentioned in the summary.

apps/webapp/app/components/BlankStatePanels.tsx (2)

203-206: Button variant change aligns with PR objectives

Changing from "secondary/small" to "primary/small" for this button improves visual hierarchy and aligns with the PR objective of reverting some blank state buttons to primary status.


398-401: Consistent styling applied across blank state panels

The change from "secondary/small" to "primary/small" ensures consistency with the other similar blank state panel buttons and improves call-to-action visibility.

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.queues/route.tsx (2)

489-494: Improved button styling for environment controls

Changing the variant from "tertiary/small" to "secondary/small" creates better visual prominence for this important control, aligning with the PR objective to update the Pause Queue button variant.


498-502: Simplified tooltip implementation

Removing the unnecessary side property from the TooltipContent component allows the tooltip to use its default positioning behavior, which likely works better in this context.

apps/webapp/app/routes/storybook.buttons/route.tsx (5)

111-114: Enhanced spinner implementation for small buttons

Using a more explicit Spinner configuration with white color and specific sizing improves the visual appearance of loading states in primary and danger buttons.

Also applies to: 126-129


240-243: Consistent spinner styling for medium buttons

The explicit spinner configuration continues the pattern from small buttons, ensuring consistent loading indicators across button sizes with appropriate scaling.

Also applies to: 255-258


294-296: Improved icon contrast for large buttons

Switching from GitHubDarkIcon to GitHubLightIcon and updating the styling to use text-text-bright improves contrast and aligns with the PR objective of consistent text coloring across button types.


298-300: Standardized text styling for secondary buttons

Using text-text-bright for both the icon and text ensures consistent color treatment across all button types, as specified in the PR objectives.


321-323: Modernized size classes for extra-large buttons

Updated from the older h-5 w-5 syntax to the more concise size-5 utility class for icons, maintaining consistent sizing while using Tailwind's newer syntax conventions.

Also applies to: 325-327, 329-330, 334-335

apps/webapp/app/components/primitives/Buttons.tsx (3)

45-50: Primary button theme updated to use indigo with improved text contrast

The primary button theme has been updated to use indigo colors instead of the previous color scheme, with consistent text coloring. This aligns with the PR objective to update primary button styles to better fit the UI.


55-55: Secondary button hover state border color fixed

The hover state border color for secondary buttons has been changed from charcoal-650 to charcoal-550, creating a more visible and aesthetically pleasing hover effect as mentioned in the PR objectives.


45-59:

❓ Verification inconclusive

Verify color contrast accessibility

The changes to button colors (especially primary buttons now using indigo with bright text) should be checked for accessibility standards.

After confirming the contrast requirements, you can use tools like the WebAIM Contrast Checker to verify your specific color combinations meet accessibility standards.


🌐 Web query:

What is the minimum contrast ratio required for WCAG AA compliance for text?

💡 Result:

The minimum contrast ratio required for WCAG AA compliance is 4.5:1 for standard-sized text and 3:1 for large text[1][4][7][8]. Large text is defined as:

  • 18pt (24 CSS pixels) or larger for non-bold text
  • 14pt bold (19 CSS pixels) or larger for bold text[1][3][7][14].

This applies to both text and images of text, with three key exceptions:

  1. Incidental text (e.g., decorative elements)
  2. Inactive UI components
  3. Logos/brand names[4][7][11].

For reference, WCAG AA requires these ratios to ensure readability for users with moderately low vision or color deficiencies[7]. The enhanced AAA standard requires stricter ratios (7:1 for normal text)[5][13]. Tools like WebAIM’s Contrast Checker[13] or Accessible Web’s tool[5] can verify compliance.

Common pitfalls include miscalculating font sizes (e.g., confusing pixels with points)[3][7] and assuming brand colors are exempt from contrast rules[3][11]. Designers should prioritize contrast testing during development to avoid accessibility barriers[6][12].

Citations:


Accessibility Contrast Check for Primary Button Colors

The primary button now uses an indigo background (bg-indigo-600) with bright text. Please verify that the text and background combination meets the WCAG AA contrast ratio of 4.5:1 for standard text (or 3:1 for large text) using a tool like the WebAIM Contrast Checker.

  • File: apps/webapp/app/components/primitives/Buttons.tsx
  • Lines: 45-59, specifically the styles under the primary key for text and button.
  • Action: Ensure that the contrast between "bg-indigo-600" and the corresponding text classes (e.g., "text-text-bright") meets the required ratios. Adjust if necessary.
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Sorry, something went wrong.

@matt-aitken matt-aitken merged commit ff6359c into main Mar 27, 2025
12 checks passed
@matt-aitken matt-aitken deleted the button-style-improvements branch March 27, 2025 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants