Skip to content

feat(Table): add MoreButtonText/Color parameter#7429

Merged
ArgoZhang merged 5 commits intomainfrom
dev-more-button
Dec 26, 2025
Merged

feat(Table): add MoreButtonText/Color parameter#7429
ArgoZhang merged 5 commits intomainfrom
dev-more-button

Conversation

@ArgoZhang
Copy link
Copy Markdown
Member

@ArgoZhang ArgoZhang commented Dec 26, 2025

Link issues

fixes #7428

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

Add configurable text and color parameters for the table row "More" action button and wire them into localization and samples.

New Features:

  • Expose MoreButtonText and MoreButtonColor parameters on the Table component to customize the inline "More" action button.

Enhancements:

  • Use localized resources to provide a default label for the table "More" button when no custom text is supplied.
  • Update table column demo content and locale resources to document and showcase customization of the "More" button text and color.

Documentation:

  • Extend the table column demo description to explain how to configure the "More" button text and color.

Copilot AI review requested due to automatic review settings December 26, 2025 03:44
@bb-auto bb-auto Bot added the enhancement New feature or request label Dec 26, 2025
@bb-auto bb-auto Bot added this to the v10.1.0 milestone Dec 26, 2025
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Dec 26, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds configurable text and color parameters for the table row "More" dropdown button, wires them into rendering and localization, and updates demos and localization resources accordingly.

Sequence diagram for resolving MoreButtonText and rendering Dropdown

sequenceDiagram
    actor Developer
    participant Table_TItem as Table_TItem
    participant Localizer as Localizer
    participant Dropdown as Dropdown

    Developer->>Table_TItem: Set parameters (MoreButtonColor, MoreButtonText)
    activate Table_TItem
    Table_TItem->>Table_TItem: OnInitLocalization()
    alt MoreButtonText is null
        Table_TItem->>Localizer: Get(nameof(MoreButtonText))
        Localizer-->>Table_TItem: localized text
        Table_TItem->>Table_TItem: MoreButtonText = localized text
    else MoreButtonText is provided
        Table_TItem->>Table_TItem: Keep provided MoreButtonText
    end
    Table_TItem-->>Developer: Parameters initialized
    deactivate Table_TItem

    Developer->>Table_TItem: Render table row more button
    activate Table_TItem
    Table_TItem->>Dropdown: Create with Color = MoreButtonColor
    Table_TItem->>Dropdown: Set FixedButtonText = MoreButtonText
    Table_TItem-->>Developer: Rendered more button dropdown
    deactivate Table_TItem
Loading

Class diagram for updated Table more button customization

classDiagram
    class Table_TItem {
        +bool ShowMoreButton
        +Color MoreButtonColor
        +string MoreButtonText
        +RenderFragment_TItem MoreButtonDropdownTemplate
        +RenderFragment_TItem RenderMoreButton
        +void OnInitLocalization()
    }

    class Dropdown {
        +Color Color
        +bool IsFixedButtonText
        +string FixedButtonText
        +Size Size
        +bool IsPopover
        +string Icon
    }

    Table_TItem ..> Dropdown : uses RenderMoreButton
Loading

File-Level Changes

Change Details Files
Introduce configurable parameters for the table row "More" button and hook them into localization.
  • Add MoreButtonColor parameter with default Color.Secondary on the Table component.
  • Add MoreButtonText nullable parameter on the Table component, to be optionally set by consumers.
  • Initialize MoreButtonText from localized resources when not explicitly provided in OnInitLocalization.
src/BootstrapBlazor/Components/Table/Table.razor.Edit.cs
src/BootstrapBlazor/Components/Table/Table.razor.Localization.cs
Use the new configuration parameters when rendering the table "More" dropdown button.
  • Replace hard-coded Color.Secondary with the MoreButtonColor parameter on the Dropdown used for the row "More" actions.
  • Replace hard-coded button text with the MoreButtonText parameter in the Dropdown configuration.
src/BootstrapBlazor/Components/Table/Table.razor
Update demos and localization resources to document and support the customizable "More" button text and color.
  • Extend the ShowMoreButton demo introduction to describe MoreButtonText and MoreButtonColor behavior.
  • Add or update localization strings for MoreButtonText in both server-side and shared locale JSON files.
  • Adjust the project file if needed so new/updated localization resources are included in the build.
src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumn.razor
src/BootstrapBlazor.Server/Locales/en-US.json
src/BootstrapBlazor.Server/Locales/zh-CN.json
src/BootstrapBlazor/BootstrapBlazor.csproj
src/BootstrapBlazor/Locales/en.json
src/BootstrapBlazor/Locales/zh.json

Assessment against linked issues

Issue Objective Addressed Explanation
#7428 Add MoreButtonText and MoreButtonColor parameters to the Table component public API so they can be configured by consumers.
#7428 Use the MoreButtonText and MoreButtonColor parameters when rendering the table row "More" button instead of hard-coded values.

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
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 reviewed your changes and they look great!


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

codecov Bot commented Dec 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (8c329b9) to head (de1e9c7).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #7429   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          748       748           
  Lines        32798     32801    +3     
  Branches      4551      4552    +1     
=========================================
+ Hits         32798     32801    +3     
Flag Coverage Δ
BB 100.00% <100.00%> (?)

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.

@ArgoZhang ArgoZhang merged commit 6a17658 into main Dec 26, 2025
4 checks passed
@ArgoZhang ArgoZhang deleted the dev-more-button branch December 26, 2025 03:51
Copy link
Copy Markdown
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 adds customizable MoreButtonText and MoreButtonColor parameters to the Table component, allowing developers to override the default "More" button text and color. The changes replace the previously hardcoded text value with a localizable parameter and introduce color customization.

  • Adds MoreButtonText parameter with localization support for Chinese and English
  • Adds MoreButtonColor parameter with default value of Color.Secondary
  • Updates documentation and demo samples to showcase the new parameters

Reviewed changes

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

Show a summary per file
File Description
src/BootstrapBlazor/Locales/zh.json Adds Chinese localization for "MoreButtonText"
src/BootstrapBlazor/Locales/en.json Adds English localization for "MoreButtonText"
src/BootstrapBlazor/Components/Table/Table.razor.Localization.cs Initializes MoreButtonText with localized value
src/BootstrapBlazor/Components/Table/Table.razor.Edit.cs Defines MoreButtonText and MoreButtonColor parameters; removes BOM character
src/BootstrapBlazor/Components/Table/Table.razor Updates Dropdown to use new parameters instead of hardcoded values
src/BootstrapBlazor/BootstrapBlazor.csproj Increments version to 10.1.5-beta03; adds BOM character
src/BootstrapBlazor.Server/Locales/zh-CN.json Adds Chinese documentation text for new parameters
src/BootstrapBlazor.Server/Locales/en-US.json Adds English documentation text for new parameters
src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumn.razor Updates demo documentation to describe new parameters

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

Comment thread src/BootstrapBlazor/Components/Table/Table.razor.Edit.cs
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(Table): add MoreButtonText/Color parameter

2 participants