Skip to content

feat(Watermark): remove EditorRequired attribute#7776

Merged
ArgoZhang merged 4 commits intomainfrom
feat-water
Mar 18, 2026
Merged

feat(Watermark): remove EditorRequired attribute#7776
ArgoZhang merged 4 commits intomainfrom
feat-water

Conversation

@ArgoZhang
Copy link
Member

@ArgoZhang ArgoZhang commented Mar 18, 2026

Link issues

fixes #7775

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

Enhancements:

  • Remove the EditorRequired attribute from the Watermark component's ChildContent parameter to allow usage without mandatory content.

Copilot AI review requested due to automatic review settings March 18, 2026 00:57
@bb-auto bb-auto bot added the enhancement New feature or request label Mar 18, 2026
@bb-auto bb-auto bot added this to the v10.4.0 milestone Mar 18, 2026
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Mar 18, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Watermark component ChildContent parameter no longer enforces the EditorRequired attribute, making the slot optional at compile-time while keeping runtime behavior unchanged.

Class diagram for updated Watermark component parameter requirements

classDiagram
    namespace BootstrapBlazor.Components {
        class Watermark {
            <<partial>>
            +RenderFragment ChildContent
        }
    }
Loading

File-Level Changes

Change Details Files
Make the Watermark component's ChildContent parameter optional by removing the EditorRequired attribute.
  • Removed the EditorRequired attribute from the ChildContent RenderFragment? parameter, allowing the component to be used without a required child content at compile time.
  • Left the parameter nullable (RenderFragment?) so existing usages with or without content remain compatible.
src/BootstrapBlazor/Components/Watermark/Watermark.razor.cs
Minor Razor file normalization.
  • Normalized the Watermark.razor file header by removing a stray BOM so the namespace directive is clean.
src/BootstrapBlazor/Components/Watermark/Watermark.razor

Assessment against linked issues

Issue Objective Addressed Explanation
#7775 Remove the [EditorRequired] attribute from the Watermark component's ChildContent parameter.

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

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

  • Now that ChildContent is no longer EditorRequired, consider whether the component should handle a null ChildContent explicitly (e.g., default content or a guard) to avoid unexpected runtime behavior.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Now that `ChildContent` is no longer `EditorRequired`, consider whether the component should handle a `null` `ChildContent` explicitly (e.g., default content or a guard) to avoid unexpected runtime behavior.

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

Removes the [EditorRequired] constraint from the Watermark component’s ChildContent parameter, aligning the API with the component’s existing runtime behavior (e.g., IsPage forbids ChildContent).

Changes:

  • Removed [EditorRequired] from Watermark.ChildContent.
  • Normalized the Watermark.razor file header line (removes BOM/leading whitespace on @namespace).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/BootstrapBlazor/Components/Watermark/Watermark.razor.cs Drops [EditorRequired] from ChildContent to avoid forcing content where it may be invalid (IsPage).
src/BootstrapBlazor/Components/Watermark/Watermark.razor Normalizes the @namespace line formatting/encoding.

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

@ArgoZhang ArgoZhang merged commit 4e0b4bf into main Mar 18, 2026
4 checks passed
@ArgoZhang ArgoZhang deleted the feat-water branch March 18, 2026 01:08
@codecov
Copy link

codecov bot commented Mar 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.99%. Comparing base (60c19b9) to head (c29b6c5).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7776   +/-   ##
=======================================
  Coverage   99.99%   99.99%           
=======================================
  Files         764      764           
  Lines       33953    33953           
  Branches     4673     4673           
=======================================
  Hits        33951    33951           
  Misses          2        2           
Flag Coverage Δ
BB 99.99% <ø> (?)

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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

feat(Watermark): remove EditorRequired attribute

2 participants