Skip to content

Conversation

@ruibaby
Copy link
Member

@ruibaby ruibaby commented Dec 9, 2025

What type of PR is this?

/area ui
/kind feature
/milestone 2.22.x

What this PR does / why we need it:

Replace the old FormKit native color input with a custom color picker. The native input color doesn’t support alpha channels, and switching to a custom component solves that. It also introduces a new format option that supports rgb, hex, and hex8 (hex values with alpha).

image

example:

$formkit: color
format: hex # or hex8 / rgb
label: Select color
name: color

Fixes #5804

Does this PR introduce a user-facing change?

优化 FormKit 的 color 输入类型,支持透明度 

@f2c-ci-robot f2c-ci-robot bot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Dec 9, 2025
@f2c-ci-robot f2c-ci-robot bot added this to the 2.22.x milestone Dec 9, 2025
@f2c-ci-robot f2c-ci-robot bot added area/ui Issues or PRs related to the Halo UI kind/feature Categorizes issue or PR as related to a new feature. labels Dec 9, 2025
@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Dec 9, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign johnniang for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 9, 2025

Open in StackBlitz

@halo-dev/api-client

npm i https://pkg.pr.new/@halo-dev/api-client@8003

@halo-dev/components

npm i https://pkg.pr.new/@halo-dev/components@8003

@halo-dev/richtext-editor

npm i https://pkg.pr.new/@halo-dev/richtext-editor@8003

@halo-dev/ui-shared

npm i https://pkg.pr.new/@halo-dev/ui-shared@8003

@halo-dev/ui-plugin-bundler-kit

npm i https://pkg.pr.new/@halo-dev/ui-plugin-bundler-kit@8003

commit: b7b9700

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a custom color picker component for FormKit to replace the native HTML color input, enabling alpha channel support and multiple color format options (rgb, hex, hex8). The implementation uses the @ckpack/vue-color library's Sketch component and includes automatic text color contrast calculation for better readability.

  • Adds a new custom FormKit color input component with alpha channel support
  • Introduces three color format options: rgb, hex, and hex8
  • Moves @ckpack/vue-color dependency from the editor package to the main UI package (upgraded from 1.5.0 to 1.6.0)

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
ui/src/formkit/inputs/color/types.ts Defines the ColorFormat type for the three supported formats
ui/src/formkit/inputs/color/index.ts Registers the color input with FormKit using async component loading
ui/src/formkit/inputs/color/ColorInput.vue Implements the color picker UI with dropdown and contrast-aware text display
ui/src/formkit/formkit.config.ts Adds the new color input to FormKit's global configuration
ui/package.json Adds @ckpack/vue-color@^1.6.0 dependency to main UI package
ui/packages/editor/package.json Removes @ckpack/vue-color from editor-specific dependencies
ui/pnpm-lock.yaml Updates lock file with new dependency locations and versions
Files not reviewed (1)
  • ui/pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Dec 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.19%. Comparing base (42c374d) to head (6d18dc1).
⚠️ Report is 294 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8003      +/-   ##
============================================
+ Coverage     59.55%   61.19%   +1.63%     
- Complexity     3812     3933     +121     
============================================
  Files           677      689      +12     
  Lines         23248    23507     +259     
  Branches       1500     1522      +22     
============================================
+ Hits          13846    14385     +539     
+ Misses         8764     8395     -369     
- Partials        638      727      +89     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ruibaby ruibaby merged commit ac44992 into halo-dev:main Dec 10, 2025
3 checks passed
@sonarqubecloud
Copy link

@ruibaby ruibaby deleted the feat/formkit-color branch December 10, 2025 06:46
@ruibaby ruibaby modified the milestones: 2.22.x, 2.22.0 Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ui Issues or PRs related to the Halo UI kind/feature Categorizes issue or PR as related to a new feature. release-note Denotes a PR that will be considered when it comes time to generate release notes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

表单定义里的 color 组件

1 participant