Skip to content

fix(EditorForm): GroupName not work#7568

Merged
ArgoZhang merged 2 commits intomainfrom
fix-editor
Jan 23, 2026
Merged

fix(EditorForm): GroupName not work#7568
ArgoZhang merged 2 commits intomainfrom
fix-editor

Conversation

@ArgoZhang
Copy link
Copy Markdown
Member

@ArgoZhang ArgoZhang commented Jan 23, 2026

Link issues

fixes #7566

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:

  • Ensure editor form item groups are correctly formed and displayed based on GroupName.

Copilot AI review requested due to automatic review settings January 23, 2026 08:25
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Jan 23, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adjusts the EditorForm grouped item aggregation to group by GroupName instead of GroupOrder so that GroupName-based grouping works correctly.

Class diagram for updated EditorForm GroupItems grouping behavior

classDiagram
    class EditorForm_TModel_ {
        +IEnumerable~KeyValuePair_string_IOrderedEnumerable_IEditorItem__~ GroupItems
        -List_IEditorItem_ itemsCache
    }

    class IEditorItem {
        +string GroupName
        +int GroupOrder
        +int Order
        +bool IsVisible(ItemChangedType itemChangedType, bool isSearch)
    }

    class ItemChangedType

    EditorForm_TModel_ --> IEditorItem : uses
    IEditorItem --> ItemChangedType : IsVisible parameter
Loading

File-Level Changes

Change Details Files
Fix grouped editor items so they are grouped by logical group name rather than numeric group order.
  • Update GroupItems LINQ pipeline to use GroupName as the grouping key instead of GroupOrder.
  • Preserve existing ordering behavior by ordering groups by GroupName key and items within each group by their Order property.
src/BootstrapBlazor/Components/EditorForm/EditorForm.razor.cs

Assessment against linked issues

Issue Objective Addressed Explanation
#7566 Fix EditorForm so that items with different GroupName values are rendered as separate groups, allowing multiple groups to be displayed instead of only the first.

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 the bug Something isn't working label Jan 23, 2026
@bb-auto bb-auto Bot added this to the v10.2.0 milestone Jan 23, 2026
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 left some high level feedback:

  • By switching to GroupBy(GroupName) and ordering by the group key, you’ve removed any use of GroupOrder for group ordering; if the intended behavior is to preserve GroupOrder-based layout while fixing grouping, consider grouping by GroupName but ordering the resulting groups by an appropriate GroupOrder value (e.g., the minimum GroupOrder in each group).
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- By switching to GroupBy(GroupName) and ordering by the group key, you’ve removed any use of GroupOrder for group ordering; if the intended behavior is to preserve GroupOrder-based layout while fixing grouping, consider grouping by GroupName but ordering the resulting groups by an appropriate GroupOrder value (e.g., the minimum GroupOrder in each group).

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 Jan 23, 2026

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #7568   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          749       749           
  Lines        32976     32976           
  Branches      4580      4580           
=========================================
  Hits         32976     32976           
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 e79aede into main Jan 23, 2026
9 of 10 checks passed
@ArgoZhang ArgoZhang deleted the fix-editor branch January 23, 2026 08:29
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 fixes a bug in the EditorForm component where only the first group was displayed when multiple groups (GroupName) were defined. The issue was caused by grouping items by GroupOrder instead of GroupName, which caused items with different group names but the same group order value to be merged into a single group.

Changes:

  • Changed GroupItems property to group by GroupName instead of GroupOrder
  • Version bumped from 10.2.3-beta01 to 10.2.3-beta02

Reviewed changes

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

File Description
src/BootstrapBlazor/Components/EditorForm/EditorForm.razor.cs Fixed grouping logic to use GroupName instead of GroupOrder
src/BootstrapBlazor/BootstrapBlazor.csproj Version bump for beta release

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

Comment on lines +220 to 221
.GroupBy(i => i.GroupName).OrderBy(i => i.Key)
.Select(i => new KeyValuePair<string, IOrderedEnumerable<IEditorItem>>(i.First().GroupName!, i.OrderBy(x => x.Order)));
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix correctly changes the grouping from GroupOrder to GroupName, which resolves the issue where items with different GroupNames were being merged. However, groups are now ordered alphabetically by GroupName (the Key) instead of numerically by GroupOrder. This means the GroupOrder property is no longer respected for determining the display order of groups. Consider changing the ordering to respect GroupOrder while maintaining the GroupName grouping. The correct implementation should order groups by their GroupOrder value, not by their name.

Suggested change
.GroupBy(i => i.GroupName).OrderBy(i => i.Key)
.Select(i => new KeyValuePair<string, IOrderedEnumerable<IEditorItem>>(i.First().GroupName!, i.OrderBy(x => x.Order)));
.GroupBy(i => i.GroupName).OrderBy(g => g.Min(x => x.GroupOrder))
.Select(g => new KeyValuePair<string, IOrderedEnumerable<IEditorItem>>(g.First().GroupName!, g.OrderBy(x => x.Order)));

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(EditorForm): 设置 GroupName 参数无效

2 participants