Skip to content
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

MBL-2043 Replace button components with new ones #2231

Merged
merged 16 commits into from
Feb 20, 2025
Merged

Conversation

jlplks
Copy link
Contributor

@jlplks jlplks commented Feb 18, 2025

📲 What

This PR introduces a new Buttons component (KSButtonsV2.kt) that manages multiple button types and their respective states. Additionally, a new color management class (KSButtonsColors.kt) has been added to ensure consistency across the design system.

All buttons are now previewed in DesignSystemActivity.kt for validation.


🤔 Why

It's part of the new Design System Implementation. This update:

  • Centralizes button styles and behavior into a single component.
  • Improves maintainability with a sealed class (KSButtonType) to define different button variations.
  • Ensures consistent theming across the app with KSButtonsColors.kt.

🛠 How

1️⃣ Implemented KSButtonsV2.kt

  • Created a unified button component that supports multiple types:
    • Filled, Green, Filled Inverted, Filled Destructive
    • Borderless, Outlined, Outlined Destructive, Borderless Destructive
    • Facebook Login Button (strictly Default & Pressed states)
  • Supports four main button statuses:
    • Default
    • Pressed
    • Disabled
    • Loading
  • Uses a sealed class (KSButtonType) to manage types efficiently.

2️⃣ Added KSButtonsColors.kt for Theming

  • Centralized all button color values for better theme management.
  • Ensures each button type gets its unique color set.
  • Fixes inconsistencies in button colors across different states.

3️⃣ Integrated Previews in DesignSystemActivity.kt

  • Added a dedicated preview for each button type and state.
  • Ensures the Facebook button only has two states (Default & Pressed).

👀 See

Figma designs

buttons_design_system.webm

📋 QA

1️⃣ Run DesignSystemActivity.kt

  • This will render all button types and states for validation.

2️⃣ Verify Button States

  • Check for the following states in each button:
    • Default, Pressed, Disabled, Loading
  • Ensure that the Facebook button only has Default & Pressed states.

3️⃣ Theme Consistency

  • Ensure that all button colors match the design system.

Story 📖

MBL-2043: Replace button components with new ones

@jlplks jlplks changed the base branch from master to jpulido/MBL-2114 February 18, 2025 22:15
Base automatically changed from jpulido/MBL-2114 to master February 18, 2025 22:52
@jlplks jlplks marked this pull request as ready for review February 19, 2025 23:50
@codecov-commenter
Copy link

codecov-commenter commented Feb 20, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.90%. Comparing base (0099e7c) to head (03be0b6).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #2231   +/-   ##
=========================================
  Coverage     67.90%   67.90%           
  Complexity     2198     2198           
=========================================
  Files           356      356           
  Lines         23999    23999           
  Branches       3529     3529           
=========================================
  Hits          16297    16297           
  Misses         5856     5856           
  Partials       1846     1846           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@leighdouglas leighdouglas left a comment

Choose a reason for hiding this comment

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

lgtm! 🎉

@jlplks jlplks merged commit 2499e76 into master Feb 20, 2025
3 checks passed
@jlplks jlplks deleted the jpulido/MBL-2043 branch February 20, 2025 21:09
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.

3 participants