Skip to content

feat(SVGEditor): fingerprint CSS asset - #1242

Merged
ArgoZhang merged 4 commits into
masterfrom
dev-SVGEditor
Oct 24, 2026
Merged

ArgoZhang merged 4 commits into
masterfrom
dev-SVGEditor

Conversation

@ArgoZhang

@ArgoZhang ArgoZhang commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Link issues

fixes #1241

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

Support fingerprinted SVG editor stylesheets while making editor initialization and content updates reliably asynchronous.

New Features:

  • Add framework-aware CSS asset URL resolution for the SVG editor, including fingerprinted assets on .NET 9 and later.

Bug Fixes:

  • Ensure SVG editor initialization, content loading, and updates complete asynchronously before subsequent operations.

Enhancements:

  • Improve SVG editor initialization by scoping zoom controls to the editor container and passing the resolved stylesheet URL through the JavaScript interop.
  • Rename the JavaScript content update API to clarify its purpose.

Build:

  • Update the SVG editor project configuration to support the asset changes.

ArgoZhang and others added 2 commits October 18, 2026 14:30
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sourcery-ai

sourcery-ai Bot commented Oct 24, 2026 •

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

Reviewer's Guide

Updates SVGEditor stylesheet loading to support .NET 9 fingerprinted static assets while preserving the existing path for earlier target frameworks, by resolving the URL in Blazor and passing it to JavaScript.

Sequence diagram for fingerprinted SVGEditor stylesheet loading

sequenceDiagram
    participant SvgEditor
    participant BlazorAssets as Blazor asset resolver
    participant SvgEditorJS as SVGEditor JavaScript
    participant Browser

    SvgEditor->>BlazorAssets: Resolve Assets[StylePath]
    BlazorAssets-->>SvgEditor: Fingerprinted styleUrl
    SvgEditor->>SvgEditorJS: init(id, options, styleUrl)
    SvgEditorJS->>Browser: addLink(styleUrl)
    Browser-->>SvgEditorJS: Stylesheet loaded
    SvgEditorJS->>SvgEditorJS: new Editor(document.getElementById(id))
Loading

File-Level Changes

Change Details Files
Pass the fingerprinted CSS asset URL from the Blazor component into the JavaScript initializer.
  • Define the shared CSS asset path.
  • Resolve the asset through the generated asset map on .NET 9 and retain the static path for earlier targets.
  • Provide the resolved URL as an additional initialization argument.
src/components/BootstrapBlazor.SVGEditor/Components/SvgEditor/SvgEditor.razor.cs
Load the SVG editor stylesheet using the URL supplied by the component.
  • Extend the initializer to accept a stylesheet URL.
  • Use the supplied URL when adding the CSS link instead of hard-coding the asset path.
src/components/BootstrapBlazor.SVGEditor/Components/SvgEditor/SvgEditor.razor.js

Assessment against linked issues

Issue Objective Addressed Explanation
#1241 Load the SVG editor CSS using its fingerprinted static-asset URL. ✅

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

bb-auto[bot]
bb-auto Bot previously approved these changes Oct 24, 2026

@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

bb-auto[bot]
bb-auto Bot previously approved these changes Oct 24, 2026

@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

@sourcery-ai sourcery-ai 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.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@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 merged commit f1d1bd2 into master Oct 24, 2026
3 checks passed
@ArgoZhang
ArgoZhang deleted the dev-SVGEditor branch October 24, 2026 00:59
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.

feat(SVGEditor): fingerprint CSS asset

1 participant