Skip to content

Conversation

@ArgoZhang
Copy link
Member

@ArgoZhang ArgoZhang commented Dec 23, 2025

Link issues

fixes #7396

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

Document the editor file upload callback in the sample editors page and update related localized descriptions.

Enhancements:

  • Extend localization entries to describe the editor file upload behavior in both English and Chinese locales.

Documentation:

  • Add documentation snippet showing how to configure the EditorUploadFile OnFileUpload callback in the editors sample view.

Copilot AI review requested due to automatic review settings December 23, 2025 01:08
@bb-auto bb-auto bot added the documentation Improvements or additions to documentation label Dec 23, 2025
@bb-auto bb-auto bot added this to the v10.1.0 milestone Dec 23, 2025
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Dec 23, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates the Editors sample page to document the EditorUploadFile-based OnFileUpload callback and adds corresponding localized description strings; project metadata is touched but without behavioral changes.

File-Level Changes

Change Details Files
Document the Editor OnFileUpload callback using EditorUploadFile in the Editors sample page.
  • Insert a label paragraph before the upload-related sample section referencing a new localized description key.
  • Show the public Func<EditorUploadFile, Task>? OnFileUpload property signature in a Pre code block.
  • Render an additional paragraph with rich-text description for the upload callback using a second localization key.
src/BootstrapBlazor.Server/Components/Samples/Editors.razor
Add localization resources for the new upload documentation text.
  • Add English resource entries for EditorsUploadDesc and EditorsUploadDesc2 explaining the upload callback usage.
  • Add Chinese resource entries for EditorsUploadDesc and EditorsUploadDesc2 mirroring the English documentation content.
src/BootstrapBlazor.Server/Locales/en-US.json
src/BootstrapBlazor.Server/Locales/zh-CN.json
Adjust server project file metadata without affecting runtime behavior.
  • Update BootstrapBlazor.Server.csproj with minor metadata or formatting changes associated with the documentation update.
src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj

Assessment against linked issues

Issue Objective Addressed Explanation
#7396 Update the Editor/EditorUploadFile documentation to describe the relevant component/property and include sample code usage.

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

@ArgoZhang ArgoZhang merged commit 21c87e5 into main Dec 23, 2025
7 of 8 checks passed
@ArgoZhang ArgoZhang deleted the refactor-editor branch December 23, 2025 01:08
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The localized description rendered via @((MarkupString)Localizer["EditorsUploadDesc2"].Value) will treat the resource string as HTML, so if it doesn’t actually need markup consider dropping the MarkupString cast to avoid accidental XSS risk and make the localization text simpler to maintain.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The localized description rendered via `@((MarkupString)Localizer["EditorsUploadDesc2"].Value)` will treat the resource string as HTML, so if it doesn’t actually need markup consider dropping the `MarkupString` cast to avoid accidental XSS risk and make the localization text simpler to maintain.

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.

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 updates the documentation for the Editor component's file upload functionality. It adds descriptions for the OnFileUpload callback and the EditorUploadFile class in both Chinese and English locales, displays this documentation in the Editors sample component, and updates the BootstrapBlazor.SummerNote package dependency to version 10.0.2.

  • Adds bilingual documentation for the file upload callback feature
  • Updates the Editors sample page to display the new documentation
  • Upgrades BootstrapBlazor.SummerNote package from 10.0.1 to 10.0.2

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/BootstrapBlazor.Server/Locales/zh-CN.json Adds Chinese documentation strings for file upload callback functionality
src/BootstrapBlazor.Server/Locales/en-US.json Adds English documentation strings for file upload callback functionality
src/BootstrapBlazor.Server/Components/Samples/Editors.razor Displays the new documentation for the file upload callback on the sample page
src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj Updates BootstrapBlazor.SummerNote package dependency to version 10.0.2

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

"EditorsDescription": "Convert the entered text into <code>html</code> code snippets",
"EditorsTips": "The <code>Editor</code> component is a secondary package of <a href='https://summernote.org/' target='_blank'><code>Summernote component</code></a>, such as If you need to use the localization function, please download the corresponding language pack from the official website and quote it by yourself. <code>zh-CN</code> <code>en-US</code> has been built in the required <code>css</code> <code>JavaScript</code> dynamically loaded on demand. If you edit too much content, <code>signalR</code> communication interruption may be triggered. Please adjust the <code>HubOptions</code> configuration.",
"EditorsUploadDesc": "Upload File Callback",
"EditorsUploadDesc2": "After the component sets a callback, when a file is selected for upload within the component, it will be returned to the caller as an instance of <code>EditorUploadFile</code>. The <code>Stream</code> property allows saving to the server or directly storing to Cloud Object Storage (OSS). The callback return value is the <b>Url</b> used for previewing the stored file.",
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

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

The English documentation could be clearer. Consider rephrasing "The Stream property allows saving to the server" to "The Stream property allows you to save to the server" or "Through the Stream property, you can save to the server" for better grammatical flow.

Suggested change
"EditorsUploadDesc2": "After the component sets a callback, when a file is selected for upload within the component, it will be returned to the caller as an instance of <code>EditorUploadFile</code>. The <code>Stream</code> property allows saving to the server or directly storing to Cloud Object Storage (OSS). The callback return value is the <b>Url</b> used for previewing the stored file.",
"EditorsUploadDesc2": "After the component sets a callback, when a file is selected for upload within the component, it will be returned to the caller as an instance of <code>EditorUploadFile</code>. The <code>Stream</code> property allows you to save to the server or directly store to Cloud Object Storage (OSS). The callback return value is the <b>Url</b> used for previewing the stored file.",

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Dec 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (41c96ae) to head (84d26a1).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #7397   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          748       748           
  Lines        32793     32793           
  Branches      4551      4551           
=========================================
  Hits         32793     32793           
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.

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(Editor): update EditorUploadFile docmentation

2 participants