Skip to content

feat(ColorPicker): bump pickr version 1.10.0#8267

Merged
ArgoZhang merged 3 commits into
mainfrom
test-table
Jul 24, 2026
Merged

feat(ColorPicker): bump pickr version 1.10.0#8267
ArgoZhang merged 3 commits into
mainfrom
test-table

Conversation

@ArgoZhang

@ArgoZhang ArgoZhang commented Jul 24, 2026

Copy link
Copy Markdown
Member

Link issues

fixes #8266

Summary By Copilot

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Merge the latest code from the main branch

Summary by Sourcery

Update ColorPicker to load the new Pickr script and assets dynamically and remove the legacy ES5 bundle.

New Features:

  • Load Pickr color picker script dynamically when opacity support is enabled.

Enhancements:

  • Switch ColorPicker to use the modern pickr.min.js asset instead of the deprecated pickr.es5.min.js bundle.

Build:

  • Adjust static asset layout to replace pickr.es5.min.js with pickr.min.js in the wwwroot lib/pickr directory.

@bb-auto bb-auto Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Auto approved by bb-auto

@ArgoZhang
ArgoZhang enabled auto-merge (squash) July 24, 2026 06:54
@sourcery-ai

sourcery-ai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates 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 ColorPicker

sequenceDiagram
    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
Loading

File-Level Changes

Change Details Files
Switch ColorPicker from the old ES5 Pickr build to the new dynamically-loaded minified Pickr script.
  • Stop importing the legacy pickr.es5.min.js module directly in the ColorPicker JavaScript entrypoint.
  • Extend utility imports to include addScript so scripts can be injected at runtime.
  • Load pickr.min.js dynamically via addScript when opacity support is enabled, alongside the existing nano.min.css.
  • Remove the deprecated pickr.es5.min.js asset and add the new pickr.min.js asset under the pickr library path.
src/BootstrapBlazor/Components/ColorPicker/ColorPicker.razor.js
src/BootstrapBlazor/wwwroot/lib/pickr/pickr.es5.min.js
src/BootstrapBlazor/wwwroot/lib/pickr/pickr.min.js
src/BootstrapBlazor/wwwroot/lib/pickr/nano.min.css

Assessment against linked issues

Issue Objective Addressed Explanation
#8266 Update the ColorPicker's bundled Pickr assets (JavaScript and any related files) to Pickr version 1.10.0.
#8266 Ensure the ColorPicker component loads the updated Pickr assets correctly at runtime instead of the old pickr.es5.min.js.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've found 1 issue, and left some high level feedback:

  • 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.
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>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread src/BootstrapBlazor/Components/ColorPicker/ColorPicker.razor.js
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (d4bca8a) to head (b22a5a6).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #8267   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          769       769           
  Lines        34436     34436           
=========================================
  Hits         34436     34436           
Flag Coverage Δ
BB 100.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

@ArgoZhang ArgoZhang added the enhancement New feature or request label Jul 24, 2026
@ArgoZhang ArgoZhang added this to the v10.8.0 milestone Jul 24, 2026
@ArgoZhang
ArgoZhang merged commit 81e970e into main Jul 24, 2026
7 checks passed
@ArgoZhang
ArgoZhang deleted the test-table branch July 24, 2026 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(ColorPicker): bump pickr version 1.10.0

1 participant