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

[Refactor] Extract color selector as component #2620

Merged
merged 3 commits into from
Feb 18, 2025
Merged

[Refactor] Extract color selector as component #2620

merged 3 commits into from
Feb 18, 2025

Conversation

huchenlei
Copy link
Member

@huchenlei huchenlei commented Feb 18, 2025

Color Customization Component Refactor

This PR extracts the color selection functionality into a reusable ColorCustomizationSelector component, improving code maintainability and reusability across the application.

Changes

  • Created new ColorCustomizationSelector.vue component that handles both predefined and custom color selection
  • Updated CustomizationDialog.vue to use the new component
  • Simplified color state management by using a single finalColor ref instead of separate states for predefined/custom colors
  • Improved type safety with TypeScript props definitions
  • Maintained existing functionality while reducing code duplication

Testing

  • Verify that both predefined and custom color selection work as before
  • Confirm that color reset and initialization work correctly
  • Check that color updates are properly emitted to parent components

The refactor makes the color selection logic more maintainable and easier to reuse in other parts of the application where color customization is needed.

┆Issue is synchronized with this Notion page by Unito

@huchenlei huchenlei requested a review from a team as a code owner February 18, 2025 19:56
@huchenlei huchenlei merged commit d1a682b into main Feb 18, 2025
9 of 10 checks passed
@huchenlei huchenlei deleted the color_picker branch February 18, 2025 20:28
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.

1 participant