Skip to content

Conversation

@ArgoZhang
Copy link
Member

@ArgoZhang ArgoZhang commented Oct 25, 2025

Link issues

fixes #6785
fixes #7002

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

Add comprehensive documentation for Blazor hosting models, enhance the project template page with visuals, integrate a navigation link, and update localization resources.

New Features:

  • Add Blazor hosting model documentation page (HostModel.razor) detailing Server, WebAssembly, and Hybrid modes with images and guidance
  • Enhance the project template page (Template.razor) with descriptive text and an illustrative image
  • Add a "HostMode" navigation menu item linking to the hosting model documentation

Documentation:

  • Update localization files (en-US.json, zh-CN.json) and docs.json with new keys for hosting model and template descriptions

Copilot AI review requested due to automatic review settings October 25, 2025 11:24
@bb-auto bb-auto bot added the documentation Improvements or additions to documentation label Oct 25, 2025
@bb-auto bb-auto bot added this to the 9.11.0 milestone Oct 25, 2025
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Oct 25, 2025

Reviewer's Guide

This PR introduces a new Razor page for ASP.NET Core Blazor hosting model documentation, integrates it into the navigation and template views, and supplies the corresponding localized strings and assets.

File-Level Changes

Change Details Files
Add hosting model documentation page
  • Created a new HostModel.razor page with headings, lists of hosting types, images, and video embed
  • Injected WebsiteOptions to resolve asset URLs
  • Linked to official Blazor hosting model documentation
src/BootstrapBlazor.Server/Components/Pages/HostModel.razor
Integrate Host Mode into navigation
  • Inserted a new menu item for HostModel in AddQuickStar
  • Used Localizer key "HostMode" for display text
src/BootstrapBlazor.Server/Extensions/MenusLocalizerExtensions.cs
Enhance template page with description and imagery
  • Added a localized list label and description block
  • Inserted template screenshot with responsive styling
  • Ensured Template.razor still includes video component
src/BootstrapBlazor.Server/Components/Pages/Template.razor
Update localization entries
  • Added HostMode, TemplateList, and TemplateDesc keys in en-US.json and zh-CN.json
  • Updated docs.json to reference the new hosting model page
src/BootstrapBlazor.Server/Locales/en-US.json
src/BootstrapBlazor.Server/Locales/zh-CN.json
src/BootstrapBlazor.Server/docs.json

Assessment against linked issues

Issue Objective Addressed Explanation
#7002 Add documentation describing the hosting model for the project.
#7002 Add sample code for the hosting model component.

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

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 adds documentation for Blazor hosting models to help guide users, particularly newcomers, in choosing the appropriate hosting configuration. The documentation explains the three main Blazor hosting models and provides recommendations for beginners.

Key Changes:

  • Added a new "Hosting Models" documentation page with explanations and recommendations
  • Updated navigation menus and localization files to include the new hosting documentation
  • Enhanced the project template documentation with visual aids

Reviewed Changes

Copilot reviewed 6 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
docs.json Added video reference for the hosting documentation page
zh-CN.json Added Chinese localization strings for hosting models menu and template list section
en-US.json Added English localization strings for hosting models menu and template list section
MenusLocalizerExtensions.cs Added "HostMode" menu item to the navigation structure
Template.razor Added template list section with description and image
HostModel.razor New documentation page explaining Blazor hosting models with recommendations

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

sourcery-ai[bot]
sourcery-ai bot previously approved these changes Oct 25, 2025
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 there - I've reviewed your changes - here's some feedback:

  • HostModel.razor uses hardcoded Chinese text rather than Localizer resources—internationalize the content for other locales
  • Add descriptive alt attributes to your tags for accessibility
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- HostModel.razor uses hardcoded Chinese text rather than Localizer resources—internationalize the content for other locales
- Add descriptive alt attributes to your <img> tags for accessibility

## Individual Comments

### Comment 1
<location> `src/BootstrapBlazor.Server/Components/Pages/HostModel.razor:18` </location>
<code_context>
+
+<p>使用最新版 <code>Visual Studio</code> 新建 <code>Blazor</code> 项目时选择 <code>Blazor Web App</code></p>
+
+<img src="@WebsiteOption.Value.GetAssetUrl("images/blazor-web-app.png")" style="width: 100%; max-width: 780px;" />
+
+<p><code>Interactive render mode</code> 又分为以下几种方式</p>
</code_context>

<issue_to_address>
**suggestion:** The inline style for the image sets width to 100% and max-width to 780px, which may cause layout issues on smaller screens.

Use responsive CSS classes for the image to improve maintainability and ensure proper display on all screen sizes.

Suggested implementation:

```
<img src="@WebsiteOption.Value.GetAssetUrl("images/blazor-web-app.png")" class="img-fluid blazor-web-app-img" />

```

You should add the following CSS to your stylesheet (e.g., `site.css` or a scoped CSS file for this component) to ensure the image does not exceed 780px in width:

```css
.blazor-web-app-img {
    max-width: 780px;
}
```

If you are not using Bootstrap, replace `img-fluid` with your project's equivalent responsive image class.
</issue_to_address>

### Comment 2
<location> `src/BootstrapBlazor.Server/Components/Pages/Template.razor:30` </location>
<code_context>
+<p class="code-label">@Localizer["TemplateList"]</p>
+<p>@((MarkupString)Localizer["TemplateDesc"].Value)</p>
+
+<img src="@WebsiteOption.Value.GetAssetUrl("images/bb-template.png")" style="width: 100%; max-width: 500px; margin-bottom: 1rem;" />
+
 <Video Name="template" />
</code_context>

<issue_to_address>
**suggestion:** Inline styles for the image may reduce maintainability and responsiveness.

Move the image styles to a CSS class or stylesheet for better maintainability and consistent responsiveness.

Suggested implementation:

```
<img src="@WebsiteOption.Value.GetAssetUrl("images/bb-template.png")" class="template-image" />

```

```

<style>
    .template-image {
        width: 100%;
        max-width: 500px;
        margin-bottom: 1rem;
        height: auto;
        display: block;
    }
</style>

<Video Name="template" />

```
</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.

@codecov
Copy link

codecov bot commented Oct 25, 2025

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #7003   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          741       741           
  Lines        32397     32397           
  Branches      4485      4485           
=========================================
  Hits         32397     32397           
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.

@ArgoZhang ArgoZhang merged commit daa5d79 into main Oct 25, 2025
5 checks passed
@ArgoZhang ArgoZhang deleted the doc-model branch October 25, 2025 11:28
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(Hosting): add hosting model documentation 建议文档增加不同模式的区别介绍

2 participants