Skip to content

Conversation

@Tony-ST0754
Copy link
Collaborator

@Tony-ST0754 Tony-ST0754 commented Feb 3, 2026

table编辑弹窗中增加控制label宽度参数,另label对齐参数看组件内的那个名称有但是好像对应另一种编辑模式,没敢动

Link issues

fixes #7620

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 label width support for table edit dialogs and wire it through to the underlying edit dialog and form components.

New Features:

  • Introduce an EditDialogLabelWidth parameter on Table to control label width in edit dialogs.
  • Add LabelWidth configuration to EditDialog, EditDialogOption, TableEditDrawerOption, and ITableEditDialogOption to propagate label width settings into validate and editor forms.

Enhancements:

  • Clarify that the ItemsPerRow parameter on Table applies specifically to the edit dialog layout.

table编辑弹窗中增加控制label宽度参数,另label对齐参数看组件内的那个名称有但是好像对应另一种编辑模式,没敢动
@bb-auto
Copy link

bb-auto bot commented Feb 3, 2026

Thanks for your PR, @Tony-ST0754. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@bb-auto bb-auto bot requested a review from ArgoZhang February 3, 2026 08:20
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Feb 3, 2026

Reviewer's Guide

Adds configurable label width support for table edit dialogs and propagates the new parameter through table, dialog, and option types, wiring it into the underlying form components.

Sequence diagram for label width propagation in table edit dialog

sequenceDiagram
    actor User
    participant TableComponent as Table
    participant EditOption as TableEditDialogOption
    participant Ext as TableEditDialogOptionExtensions
    participant Dialog as EditDialog_TModel
    participant ValidateForm
    participant EditorForm

    User->>TableComponent: triggerEdit(row)
    TableComponent->>EditOption: createOption()
    TableComponent->>EditOption: set ItemsPerRow, DisableAutoSubmitFormByEnter, LabelWidth = EditDialogLabelWidth

    TableComponent->>Ext: ToDialogParameters(EditOption)
    Ext-->>Dialog: create EditDialog with LabelWidth = option.LabelWidth

    Dialog->>ValidateForm: render ValidateForm(Model, OnValidSubmitAsync, LabelWidth, DisableAutoSubmitFormByEnter)
    Dialog->>EditorForm: render EditorForm(Items, ItemsPerRow, LabelAlign, ShowLabel, ShowUnsetGroupItemsOnTop, LabelWidth)

    User->>ValidateForm: interactWithForm()
    ValidateForm->>EditorForm: layoutFieldsUsing(LabelWidth)
    ValidateForm-->>User: showFormWithConfiguredLabelWidth()
Loading

Updated class diagram for table edit dialog label width configuration

classDiagram
    class Table {
        +bool IsHideFooterWhenNoData
        +int EditDialogItemsPerRow
        +Alignment EditDialogLabelAlign
        +int? EditDialogLabelWidth
        +void AppendOptions(ITableEditDialogOption_TItem option, ItemChangedType itemChangedType)
    }

    class ITableEditDialogOption_TModel {
        +bool? DisableAutoSubmitFormByEnter
        +int? LabelWidth
        +RenderFragment DialogFooterTemplate
    }

    class TableEditDrawerOption {
        +TableEditDrawerOption()
        +bool? DisableAutoSubmitFormByEnter
        +int? LabelWidth
    }

    class EditDialog_TModel {
        +bool? DisableAutoSubmitFormByEnter
        +int? LabelWidth
        +int ItemsPerRow
        +Alignment LabelAlign
        +bool ShowLabel
        +bool ShowUnsetGroupItemsOnTop
        +Task OnValidSubmitAsync(EditContext context)
    }

    class EditDialogOption {
        +EditDialogOption()
        +bool? DisableAutoSubmitFormByEnter
        +int? LabelWidth
    }

    class TableEditDialogOptionExtensions {
        +IDictionary~string,object~ ToDialogParameters(EditDialogOption option)
    }

    class ValidateForm {
        +object Model
        +Func~EditContext,Task~ OnValidSubmit
        +bool? DisableAutoSubmitFormByEnter
        +int? LabelWidth
    }

    class EditorForm {
        +int ItemsPerRow
        +Alignment LabelAlign
        +bool ShowLabel
        +bool ShowUnsetGroupItemsOnTop
        +int? LabelWidth
    }

    Table ..> ITableEditDialogOption_TModel : configures
    Table ..> EditDialogOption : uses
    TableEditDrawerOption ..|> ITableEditDialogOption_TModel : implements
    EditDialog_TModel ..> ValidateForm : renders
    EditDialog_TModel ..> EditorForm : renders
    EditDialogOption --> EditDialog_TModel : configures
    TableEditDialogOptionExtensions ..> EditDialogOption : extends
    TableEditDialogOptionExtensions ..> EditDialog_TModel : maps properties
    ITableEditDialogOption_TModel --> EditDialogOption : base configuration
    EditDialog_TModel --> EditorForm : passes LabelWidth
    EditDialog_TModel --> ValidateForm : passes LabelWidth
    Table --> EditDialog_TModel : opens edit dialog with LabelWidth
Loading

File-Level Changes

Change Details Files
Introduce configurable label width parameter on the table edit dialog and propagate it through dialog options.
  • Add EditDialogLabelWidth parameter to the Table component, defaulting to 120
  • Pass EditDialogLabelWidth into ITableEditDialogOption via AppendOptions in Table toolbar logic
  • Extend ITableEditDialogOption and TableEditDrawerOption with a nullable LabelWidth property, default 120
src/BootstrapBlazor/Components/Table/Table.razor.cs
src/BootstrapBlazor/Components/Table/Table.razor.Toolbar.cs
src/BootstrapBlazor/Components/Table/ITableEditDialogOption.cs
src/BootstrapBlazor/Components/Table/TableEditDrawerOption.cs
Wire label width through EditDialog and underlying form components so it affects rendering.
  • Add nullable LabelWidth parameter to EditDialog with default 120
  • Add LabelWidth property to EditDialogOption with default 120
  • Bind LabelWidth into ValidateForm and EditorForm usages in EditDialog.razor
  • Map option.LabelWidth into EditDialog.LabelWidth in TableEditDialogOptionExtensions
src/BootstrapBlazor/Components/Dialog/EditDialog.razor.cs
src/BootstrapBlazor/Components/Dialog/EditDialogOption.cs
src/BootstrapBlazor/Components/Dialog/EditDialog.razor
src/BootstrapBlazor/Extensions/TableEditDialogOptionExtensions.cs
Clarify documentation for existing ItemsPerRow parameter as specific to edit dialogs.
  • Update XML doc comment to specify that ItemsPerRow is for the edit dialog rows
src/BootstrapBlazor/Components/Table/Table.razor.cs

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:

  • The default label width value 120 is now hard‑coded in several places (EditDialogLabelWidth, EditDialog.LabelWidth, EditDialogOption.LabelWidth, TableEditDrawerOption.LabelWidth); consider centralizing this as a shared constant or config to avoid divergence in future changes.
  • TableEditDrawerOption.LabelWidth has been added but there’s no corresponding wiring like in AppendOptions for dialogs; if drawer edit UIs are also expected to honor the label width, consider passing this through in the drawer path as well for consistent behavior.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The default label width value `120` is now hard‑coded in several places (`EditDialogLabelWidth`, `EditDialog.LabelWidth`, `EditDialogOption.LabelWidth`, `TableEditDrawerOption.LabelWidth`); consider centralizing this as a shared constant or config to avoid divergence in future changes.
- `TableEditDrawerOption.LabelWidth` has been added but there’s no corresponding wiring like in `AppendOptions` for dialogs; if drawer edit UIs are also expected to honor the label width, consider passing this through in the drawer path as well for consistent 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.

@codecov
Copy link

codecov bot commented Feb 3, 2026

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #7621   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          749       749           
  Lines        33015     33017    +2     
  Branches      4581      4581           
=========================================
+ Hits         33015     33017    +2     
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 changed the title table组件编辑弹窗增加 lable标签宽度控制参数 #7620 feat(ITableEditDialogOption): add LabelWidth parameter Feb 3, 2026
@ArgoZhang ArgoZhang merged commit 4b2f98c into main Feb 3, 2026
6 checks passed
@ArgoZhang ArgoZhang deleted the Table-EditDialog branch February 3, 2026 11:36
@bb-auto bb-auto bot added the enhancement New feature or request label Feb 3, 2026
@bb-auto bb-auto bot added this to the v10.3.0 milestone Feb 3, 2026
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): 编辑弹窗增加 lable 标签宽度控制参数

2 participants