fix(DockView): add JsonIgnore attribute on TitleTemplate#991
Merged
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds JSON serialization protection to the DockViewComponent’s TitleTemplate parameter to prevent it from being serialized when the component state is converted to JSON. Class diagram for updated DockViewComponent TitleTemplate parameterclassDiagram
class DockViewComponent {
<<component>>
+RenderFragment TitleTemplate
}
class JsonIgnoreAttribute {
}
DockViewComponent ..> JsonIgnoreAttribute : applies_to TitleTemplate
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.
Hey - I've left some high level feedback:
- If this component is serialized in multiple contexts, double‑check that
JsonIgnoreis from the same JSON library actually used at runtime (e.g.,System.Text.Json.Serialization.JsonIgnorevsNewtonsoft.Json.JsonIgnore) to avoid surprises. - Consider reviewing other
RenderFragment(or similarly non‑serializable) parameters on DockView components to ensure they are consistently marked withJsonIgnorewhere serialization is expected.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- If this component is serialized in multiple contexts, double‑check that `JsonIgnore` is from the same JSON library actually used at runtime (e.g., `System.Text.Json.Serialization.JsonIgnore` vs `Newtonsoft.Json.JsonIgnore`) to avoid surprises.
- Consider reviewing other `RenderFragment` (or similarly non‑serializable) parameters on DockView components to ensure they are consistently marked with `JsonIgnore` where serialization is expected.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Pull request overview
This PR updates the DockView component model to be safely JSON-serializable by excluding a UI-only RenderFragment parameter from serialization, and bumps the DockView package version accordingly.
Changes:
- Mark
DockViewComponent.TitleTemplatewith[JsonIgnore]to prevent JSON serialization errors (RenderFragment is not serializable). - Bump
BootstrapBlazor.DockViewpackage version from10.0.10to10.0.11.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/components/BootstrapBlazor.DockView/Components/DockViewComponent.razor.cs |
Adds [JsonIgnore] to TitleTemplate to avoid serializing a RenderFragment as part of config/state JSON. |
src/components/BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj |
Increments package version to publish the serialization-related change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link issues
fixes #990
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Bug Fixes: