-
-
Notifications
You must be signed in to change notification settings - Fork 362
doc(Hosting): add hosting model documentation #7003
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's GuideThis 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
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this 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.
There was a problem hiding this 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>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Link issues
fixes #6785
fixes #7002
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
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:
Documentation: