Skip to content

doc(IDom2HtmlService): update documentation#7885

Merged
ArgoZhang merged 5 commits intomainfrom
copilot/add-dom2htmlservice-documentation
Apr 19, 2026
Merged

doc(IDom2HtmlService): update documentation#7885
ArgoZhang merged 5 commits intomainfrom
copilot/add-dom2htmlservice-documentation

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 18, 2026

Link issues

close #7890

Summary By Copilot

Dom2Image docs were missing required runtime setup details, which could cause service resolution or large-payload transfer failures.
This update adds explicit bilingual guidance for both manual service registration and SignalR message-size configuration.

  • Dom2Images demo doc content

    • Added a Tips block in Dom2Images.razor before the demo.
    • Documented required manual DI registration for Dom2Image service.
    • Documented required SignalR MaximumReceiveMessageSize setup using a concrete 10 MB example.
  • Localization (zh-CN / en-US)

    • Added localized keys:
      • Dom2ImageServiceInjectTip
      • Dom2ImageSignalRConfigTip
    • Wired new keys into the Dom2Images sample page so both locales render the same setup guidance.
builder.Services.AddBootstrapBlazorDom2ImageService();

builder.Services.AddSignalR(options =>
{
    options.MaximumReceiveMessageSize = 10 * 1024 * 1024; // 10 MB
});

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

Document required runtime configuration for the Dom2Images sample, including DI setup and SignalR payload limits.

Documentation:

  • Add a tips section to the Dom2Images sample page explaining required Dom2Image service registration and SignalR MaximumReceiveMessageSize configuration.
  • Localize the new Dom2Images setup guidance for both en-US and zh-CN so the tips are available in both languages.

@bb-auto
Copy link
Copy Markdown

bb-auto bot commented Apr 18, 2026

Thanks for your PR, @copilot. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@bb-auto bb-auto bot requested review from ArgoZhang and h2ls April 18, 2026 07:57
@h2ls h2ls marked this pull request as ready for review April 18, 2026 07:57
Copilot AI review requested due to automatic review settings April 18, 2026 07:57
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai bot commented Apr 18, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates the Dom2Images sample documentation to show required DI setup for Dom2Image and SignalR message-size configuration, and wires corresponding localized strings in both en-US and zh-CN locale files.

Sequence diagram for Dom2Images sample using Dom2Image service and SignalR

sequenceDiagram
    actor User
    participant Browser
    participant Dom2ImagesPage
    participant DIContainer
    participant Dom2ImageService
    participant SignalRHubDom2Image

    User->>Browser: Navigate to Dom2Images sample
    Browser->>Dom2ImagesPage: Render page
    Dom2ImagesPage->>DIContainer: Request Dom2ImageService
    DIContainer-->>Dom2ImagesPage: Provide Dom2ImageService instance

    User->>Browser: Trigger capture to image
    Browser->>Dom2ImagesPage: Invoke capture handler
    Dom2ImagesPage->>Dom2ImageService: Convert DOM to image payload
    Dom2ImageService-->>Dom2ImagesPage: Image payload

    Dom2ImagesPage->>SignalRHubDom2Image: Send image over SignalR
    Note over SignalRHubDom2Image: Enforces MaximumReceiveMessageSize (e.g. 10 MB)
    SignalRHubDom2Image-->>Dom2ImagesPage: Acknowledge or broadcast result
    Dom2ImagesPage-->>Browser: Update UI with generated image
Loading

File-Level Changes

Change Details Files
Add setup tips section to the Dom2Images sample explaining required DI and SignalR configuration.
  • Insert a Tips block before the demo content in the Dom2Images sample page.
  • Render localized explanatory text for Dom2Image service registration using the page Localizer.
  • Render localized explanatory text and a concrete code example for configuring SignalR MaximumReceiveMessageSize to 10 MB.
src/BootstrapBlazor.Server/Components/Samples/Dom2Images.razor
Introduce new localization resources for the Dom2Images setup tips in both English and Chinese.
  • Add Dom2ImageServiceInjectTip and Dom2ImageSignalRConfigTip entries to the en-US locale JSON file.
  • Add Dom2ImageServiceInjectTip and Dom2ImageSignalRConfigTip entries to the zh-CN locale JSON file.
  • Ensure the new keys match those referenced by the Dom2Images sample so both locales render the same guidance.
src/BootstrapBlazor.Server/Locales/en-US.json
src/BootstrapBlazor.Server/Locales/zh-CN.json

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

Copy link
Copy Markdown
Collaborator

@h2ls h2ls left a comment

Choose a reason for hiding this comment

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

noting

Copy link
Copy Markdown
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

Updates the Dom2Image sample documentation in the BootstrapBlazor.Server demo to clarify required runtime setup (service registration + SignalR payload size) and provides the same guidance in both en-US and zh-CN locales.

Changes:

  • Add a Tips block to the Dom2Images sample page showing DI registration and SignalR payload configuration guidance.
  • Add localized strings (en-US / zh-CN) for the new guidance.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/BootstrapBlazor.Server/Locales/zh-CN.json Adds zh-CN localized tips for Dom2Image setup guidance.
src/BootstrapBlazor.Server/Locales/en-US.json Adds en-US localized tips for Dom2Image setup guidance.
src/BootstrapBlazor.Server/Components/Samples/Dom2Images.razor Renders the new localized Tips block and configuration snippets on the Dom2Image sample page.

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

Comment thread src/BootstrapBlazor.Server/Locales/en-US.json Outdated
Comment thread src/BootstrapBlazor.Server/Locales/zh-CN.json Outdated
Comment thread src/BootstrapBlazor.Server/Components/Samples/Dom2Images.razor Outdated
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (77bb3ef) to head (58fea1d).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #7885   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          764       764           
  Lines        34173     34173           
  Branches      4702      4702           
=========================================
  Hits         34173     34173           
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 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.

@ArgoZhang ArgoZhang changed the title docs: clarify Dom2HtmlService DI and SignalR payload config for Dom2Image sample doc(IDom2HtmlService): update documentation Apr 19, 2026
@ArgoZhang ArgoZhang merged commit 3c888bf into main Apr 19, 2026
4 checks passed
@ArgoZhang ArgoZhang deleted the copilot/add-dom2htmlservice-documentation branch April 19, 2026 02:21
@bb-auto bb-auto bot assigned ArgoZhang and unassigned h2ls and Copilot Apr 19, 2026
@bb-auto bb-auto bot added the documentation Improvements or additions to documentation label Apr 19, 2026
@bb-auto bb-auto bot added this to the v10.5.0 milestone Apr 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

doc(IDom2HtmlService): update documentation

4 participants