Skip to content

fix(DockView): add JsonIgnore attribute on TitleTemplate#991

Merged
ArgoZhang merged 2 commits into
masterfrom
feat-dockview
May 9, 2026
Merged

fix(DockView): add JsonIgnore attribute on TitleTemplate#991
ArgoZhang merged 2 commits into
masterfrom
feat-dockview

Conversation

@ArgoZhang
Copy link
Copy Markdown
Member

@ArgoZhang ArgoZhang commented May 9, 2026

Link issues

fixes #990

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

Bug Fixes:

  • Prevent DockView TitleTemplate render fragment from being serialized as JSON.

Copilot AI review requested due to automatic review settings May 9, 2026 11:05
@bb-auto bb-auto Bot added the enhancement New feature or request label May 9, 2026
@bb-auto bb-auto Bot added this to the v9.2.0 milestone May 9, 2026
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 9, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds 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 parameter

classDiagram
    class DockViewComponent {
        <<component>>
        +RenderFragment TitleTemplate
    }

    class JsonIgnoreAttribute {
    }

    DockViewComponent ..> JsonIgnoreAttribute : applies_to TitleTemplate
Loading

File-Level Changes

Change Details Files
Prevent DockViewComponent TitleTemplate from being included in JSON serialization.
  • Added JsonIgnore attribute to the TitleTemplate RenderFragment parameter so it is excluded from JSON serialization pipelines or persisted state models.
  • Ensured that the public API surface of DockViewComponent remains the same aside from serialization behavior of TitleTemplate.
src/components/BootstrapBlazor.DockView/Components/DockViewComponent.razor.cs

Assessment against linked issues

Issue Objective Addressed Explanation
#990 Redesign the getConfig logic of the DockView component to change how configuration is obtained/serialized for DockView. The PR only adds a [JsonIgnore] attribute to the TitleTemplate property in DockViewComponent.razor.cs and makes no visible changes related to any getConfig method or configuration logic. There is no evidence in the diff that the getConfig logic has been redesigned or modified.

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
Copy Markdown

@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:

  • 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.
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.

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
Copy Markdown

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 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.TitleTemplate with [JsonIgnore] to prevent JSON serialization errors (RenderFragment is not serializable).
  • Bump BootstrapBlazor.DockView package version from 10.0.10 to 10.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.

@ArgoZhang ArgoZhang changed the title Feat dockview fix(DockView): add JsonIgnore attribute on TitleTemplate May 9, 2026
@ArgoZhang ArgoZhang merged commit b820753 into master May 9, 2026
6 checks passed
@ArgoZhang ArgoZhang deleted the feat-dockview branch May 9, 2026 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(DockView): add JsonIgnore attribute on TitleTemplate

2 participants