feat(ColorPicker): bump pickr version 1.10.0#8267
Merged
Merged
Conversation
ArgoZhang
enabled auto-merge (squash)
July 24, 2026 06:54
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates the ColorPicker component to use the newer Pickr 1.10.0 bundle by switching from the old ES5 script to the new minified script and loading it dynamically alongside its CSS when opacity support is enabled. Sequence diagram for dynamic Pickr script loading in ColorPickersequenceDiagram
participant ColorPickerModule
participant UtilityModule
participant Browser
ColorPickerModule->>ColorPickerModule: getOrCreatePickr(id, picker, options)
alt [isSupportOpacity === true]
ColorPickerModule->>UtilityModule: addLink(./_content/BootstrapBlazor/lib/pickr/nano.min.css)
UtilityModule-->>Browser: load nano.min.css
ColorPickerModule->>UtilityModule: addScript(./_content/BootstrapBlazor/lib/pickr/pickr.min.js)
UtilityModule-->>Browser: load pickr.min.js
ColorPickerModule->>ColorPickerModule: initialize pickr instance
else [isSupportOpacity !== true]
ColorPickerModule->>ColorPickerModule: skip Pickr asset loading
end
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- Confirm that
getOrCreatePickris never called in a code path whereisSupportOpacityis false but Pickr is still required, since the top-level import was removed and the script is now only loaded conditionally. - Consider guarding
addScript('./_content/BootstrapBlazor/lib/pickr/pickr.min.js')against multiple invocations to avoid duplicate script tags and potential race conditions wheninitis called repeatedly.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Confirm that `getOrCreatePickr` is never called in a code path where `isSupportOpacity` is false but Pickr is still required, since the top-level import was removed and the script is now only loaded conditionally.
- Consider guarding `addScript('./_content/BootstrapBlazor/lib/pickr/pickr.min.js')` against multiple invocations to avoid duplicate script tags and potential race conditions when `init` is called repeatedly.
## Individual Comments
### Comment 1
<location path="src/BootstrapBlazor/Components/ColorPicker/ColorPicker.razor.js" line_range="28" />
<code_context>
if (isSupportOpacity === true) {
await addLink("./_content/BootstrapBlazor/lib/pickr/nano.min.css");
+ await addScript("./_content/BootstrapBlazor/lib/pickr/pickr.min.js");
const { invoke, pickr } = picker;
</code_context>
<issue_to_address>
**issue (bug_risk):** Dynamic script loading inside the opacity-only branch may break non-opacity usages of the color picker.
Previously Pickr was always loaded via static import; now it only loads when `isSupportOpacity === true`. If any non-opacity flows still depend on Pickr (e.g., for solid color only), they’ll now run without the script and can fail at runtime. Please either load the script unconditionally (keeping CSS conditional if desired) or verify that Pickr is never used when opacity is disabled.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8267 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 769 769
Lines 34436 34436
=========================================
Hits 34436 34436
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link issues
fixes #8266
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Update ColorPicker to load the new Pickr script and assets dynamically and remove the legacy ES5 bundle.
New Features:
Enhancements:
Build: