add receiver components to docs, fix events cropper component desc, fix error during blazor server prerendering in dispose methods#453
Conversation
…ct' into feature/add_receivers_comp_to_docs
There was a problem hiding this comment.
Pull request overview
This PR enhances the documentation system by adding support for receiver components (CroppedCanvasReceiver and ImageReceiver) in the API documentation, improves event parameter documentation with more detailed descriptions, and consolidates the API page routing. The changes also include service worker lifecycle improvements and infrastructure updates for better documentation generation.
Changes:
- Enhanced XML documentation for CropperComponent events with detailed parameter descriptions
- Added receiver components (CroppedCanvasReceiver, ImageReceiver) to the API documentation menu and routing
- Consolidated Api.razor into DataContract.razor for unified API page handling
- Extended documentation compiler to generate class-level descriptions and support for component contracts
- Updated service worker to improve update detection and lifecycle management
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| CropperComponent.razor.cs | Improved component XML documentation summary |
| CropperComponent.razor.Events.cs | Enhanced event parameter documentation with detailed descriptions |
| CropperComponent.razor.Queries.cs | Removed duplicate component-level documentation |
| CropperComponent.razor.Commands.cs | Removed duplicate component-level documentation |
| CroppedCanvasReceiver.cs | Enhanced parameter documentation with cross-references |
| TypeNameHelper.cs | Added generic argument formatter support for HTML link generation |
| MethodInfoExtensions.cs | Extended TypeName method with generic part control and MemoryStream link support |
| DocStrings.cs (Compiler) | Added class documentation generation and enum description support |
| sw-registrator.js | Added service worker update logging and controller change handling |
| service-worker.published.js | Simplified service worker lifecycle event handling |
| docssection.scss | Reduced section header top margin for better spacing |
| MenuService.cs | Added receiver components to API menu with Data grouping |
| DataContract.razor.cs | Added logic to handle component types and receiver components |
| DataContract.razor | Consolidated API routing and added CropperComponent support |
| CropperDemo.razor.cs | Uncommented debug console logging statements |
| Api.razor | Removed file (functionality consolidated into DataContract.razor) |
| DocStrings.cs (Models) | Added methods for enum and class description retrieval |
| DocsApi.razor.cs | Enhanced to support component contracts and class descriptions |
| DocsApi.razor | Improved rendering for receiver components with JSInvokable indicators |
| ApiMethod.cs | Added IsJsInvokable property for method metadata |
Comments suppressed due to low confidence (3)
src/Cropper.Blazor/Client/Components/Docs/DocsApi.razor.cs:109
- This foreach loop implicitly filters its target sequence - consider filtering the sequence explicitly using '.Where(...)'.
foreach (var info in propertyInfos.OrderBy(x => x.Name))
{
if (IsEventCallback(info))
{
yield return new ApiProperty
{
Name = info.Name,
PropertyInfo = info,
Default = string.Empty,
Description = DocStrings.GetMemberDescription(saveTypename, info, IsContract, IsComponentContract),
IsTwoWay = CheckIsTwoWayEventCallback(info),
Type = info.PropertyType,
};
}
}
src/Cropper.Blazor/Client/Components/Docs/DocsApi.razor.cs:202
- Both branches of this 'if' statement write to the same variable - consider using '?' to express intent better.
if (IsContract || IsComponentContract == true)
{
types = Type
.GetPropertyInfos();
}
else
{
types = Type
.GetPropertyInfosWithAttribute<ParameterAttribute>();
}
src/Cropper.Blazor/Client/Models/DocStrings.cs:27
- Both branches of this 'if' statement write to the same variable - consider using '?' to express intent better.
if (isContract || isComponentContract == true)
{
name = saveTypename.Replace("<>", string.Empty) + "_property_" + property.Name;
}
else
{
name = saveTypename + "_" + property.Name;
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/Cropper.Blazor/Cropper.Blazor.Shared/Extensions/MethodInfoExtensions.cs
Show resolved
Hide resolved
src/Cropper.Blazor/Cropper.Blazor.Shared/Extensions/TypeNameHelper.cs
Outdated
Show resolved
Hide resolved
src/Cropper.Blazor/Cropper.Blazor.Shared/Extensions/MethodInfoExtensions.cs
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
…lper.cs Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
src/Cropper.Blazor/Cropper.Blazor.UnitTests/Services/BaseJsInteropService_Should.cs
Show resolved
Hide resolved
3ad4d86
into
feature/add_typescript_for_project
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feature/add_typescript_for_project #453 +/- ##
======================================================================
+ Coverage 80.83% 81.02% +0.18%
======================================================================
Files 29 29
Lines 929 938 +9
Branches 63 65 +2
======================================================================
+ Hits 751 760 +9
Misses 177 177
Partials 1 1
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Target
Open Questions
Checklist
Visuals