Skip to content

Conversation

@ArgoZhang
Copy link
Member

@ArgoZhang ArgoZhang commented May 3, 2025

Link issues

fixes #5942

Summary By Copilot

This pull request introduces enhancements to the Modal component in the BootstrapBlazor library, focusing on improving the customization and layout of the modal footer. The changes include adding a new FooterContentTemplate parameter, updating the modal footer layout to support flexible content, and modifying the corresponding Razor and SCSS files.

Enhancements to modal footer customization:

Layout improvements for modal footer:

  • src/BootstrapBlazor/Components/Modal/Modal.razor.scss: Added a new .modal-footer-content class with styles for flexible layout, including properties like flex-grow, white-space: nowrap, and overflow: hidden, to ensure proper alignment and handling of custom footer content.

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

Add a new FooterContentTemplate parameter to the ModalDialog component to enable more flexible footer content customization

New Features:

  • Introduce FooterContentTemplate parameter to allow custom content in modal footer

Enhancements:

  • Improve modal footer layout to support flexible custom content placement
  • Add styling for modal footer content to ensure proper alignment and overflow handling

@ArgoZhang ArgoZhang requested a review from Copilot May 3, 2025 01:41
@bb-auto bb-auto bot added the enhancement New feature or request label May 3, 2025
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented May 3, 2025

Reviewer's Guide

This pull request introduces a FooterContentTemplate parameter to the ModalDialog component. This is implemented by adding a new RenderFragment? parameter to the C# class, updating the Razor template to conditionally render this template within a new div.modal-footer-content, and adding corresponding CSS styles for layout.

File-Level Changes

Change Details Files
Add a new parameter to allow custom content in the modal footer.
  • Introduced the FooterContentTemplate parameter of type RenderFragment?.
src/BootstrapBlazor/Components/Modal/ModalDialog.razor.cs
Render the custom footer content in the modal dialog.
  • Added a conditional block to render the FooterContentTemplate inside a div with the class modal-footer-content within the modal-footer.
src/BootstrapBlazor/Components/Modal/ModalDialog.razor
Style the custom footer content container.
  • Added CSS rules for the .modal-footer-content class to manage layout using flexbox properties (e.g., flex-grow, alignment, overflow handling).
src/BootstrapBlazor/Components/Modal/Modal.razor.scss

Assessment against linked issues

Issue Objective Addressed Explanation
#5942 Add a content template to the ModalDialog component that allows users to insert custom content before the functional buttons in the footer.

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

@bb-auto bb-auto bot added this to the v9.6.0 milestone May 3, 2025
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

This PR enhances the Modal component in BootstrapBlazor to support custom footer content by introducing a new parameter and corresponding layout updates.

  • Adds a new FooterContentTemplate parameter in ModalDialog.razor.cs
  • Updates ModalDialog.razor to conditionally render the new footer content template

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
src/BootstrapBlazor/Components/Modal/ModalDialog.razor.cs Introduces the new FooterContentTemplate parameter with relevant documentation
src/BootstrapBlazor/Components/Modal/ModalDialog.razor Renders the new template inside a dedicated div for flexible footer customization
Files not reviewed (1)
  • src/BootstrapBlazor/Components/Modal/Modal.razor.scss: Language not supported
Comments suppressed due to low confidence (1)

src/BootstrapBlazor/Components/Modal/ModalDialog.razor.cs:206

  • [nitpick] The new property 'FooterContentTemplate' is similar to the existing 'FooterTemplate'. Consider clarifying the distinct purposes of these two parameters in the documentation or renaming them to reduce potential confusion.
[Parameter] public RenderFragment? FooterContentTemplate { get; set; }

sourcery-ai[bot]
sourcery-ai bot previously approved these changes May 3, 2025
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 @ArgoZhang - I've reviewed your changes - here's some feedback:

  • Consider renaming FooterContentTemplate to distinguish its purpose more clearly from the existing FooterTemplate.
  • Clarify the behavior when both FooterTemplate and FooterContentTemplate are provided.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

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.

@codecov
Copy link

codecov bot commented May 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (a6e14bd) to head (6e04c2e).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #5947   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          669       669           
  Lines        30544     30548    +4     
  Branches      4347      4348    +1     
=========================================
+ Hits         30544     30548    +4     

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

@ArgoZhang ArgoZhang merged commit 94c27d8 into main May 3, 2025
4 checks passed
@ArgoZhang ArgoZhang deleted the feat-dialog branch May 3, 2025 02:17
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(ModalDialog): 在底栏功能按钮前面增加一个内容模板

2 participants