Skip to content

Conversation

@WilliamLiu1997
Copy link
Contributor

@WilliamLiu1997 WilliamLiu1997 commented Jun 1, 2025

Link issues

fixes #6153

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

New Features:

  • Add CanExpandWhenDisabled parameter to SelectTree to allow expanding or collapsing nodes when the component is disabled

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jun 1, 2025

Reviewer's Guide

This PR adds a new boolean parameter CanExpandWhenDisabled to the SelectTree component, allowing tree nodes to be expanded or collapsed even when the component is disabled (defaulting to false).

Sequence Diagram: Conditional Node Expansion/Collapse in Disabled SelectTree

sequenceDiagram
    actor User
    participant ST as SelectTree
    participant TV as TreeView

    User->>ST: Clicks node (ST is disabled)
    ST->>TV: Forwards interaction (TreeView configured with ST.CanExpandWhenDisabled)
    alt TreeView.CanExpandWhenDisabled is true
        TV->>TV: Process expand/collapse node
        TV-->>ST: Update view / state
        ST-->>User: Node visually expands/collapses
    else TreeView.CanExpandWhenDisabled is false
        TV->>TV: Block expand/collapse node
        TV-->>ST: No view / state update
        ST-->>User: Node does not expand/collapse
    end
Loading

Class Diagram: Update to SelectTree Component

classDiagram
  class SelectTree~TValue~ {
    +bool CanExpandWhenDisabled
  }
Loading

File-Level Changes

Change Details Files
Introduce CanExpandWhenDisabled parameter to SelectTree to control expand/collapse behavior on disabled nodes
  • Define [Parameter] public bool CanExpandWhenDisabled { get; set; } = false with XML doc comment
  • Pass CanExpandWhenDisabled through to the TreeView tag in SelectTree.razor
src/BootstrapBlazor/Components/Select/SelectTree.razor.cs
src/BootstrapBlazor/Components/Select/SelectTree.razor

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

bb-auto bot commented Jun 1, 2025

Thanks for your PR, @WilliamLiu1997. 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 June 1, 2025 20:24
sourcery-ai[bot]
sourcery-ai bot previously approved these changes Jun 1, 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 @WilliamLiu1997 - I've reviewed your changes and they look great!

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.

@ArgoZhang
Copy link
Member

ArgoZhang commented Jun 5, 2025

@WilliamLiu1997 感谢提交 PR 帮忙右上角点一下 star 如果没加社区可以 QQ 群搜 795206915 加入一下。PR 需要弄一个 Issue 写清楚遇到了什么问题,PR 是解决这个问题的。方便维护与跟踪。非常感谢您的参与。

请再回复里键入,签署 CLA 协议

@microsoft-github-policy-service agree

@ArgoZhang ArgoZhang changed the title 获取或设置当SelectTree 节点处于禁用状态时,节点是否可以展开或折叠。默认值为 false。 feat(SelectTree): add CanExpandWhenDisabled parameter Jun 5, 2025
@bb-auto bb-auto bot added the enhancement New feature or request label Jun 5, 2025
@bb-auto bb-auto bot added this to the 9.7.0 milestone Jun 5, 2025
@ArgoZhang
Copy link
Member

@WilliamLiu1997 Issue 我已经关联好啦,直接回复里键入

@microsoft-github-policy-service agree

即可自动合并 PR 了

@codecov
Copy link

codecov bot commented Jun 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (8b47783) to head (5ecf542).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #6128   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          703       703           
  Lines        31119     31120    +1     
  Branches      4399      4399           
=========================================
+ Hits         31119     31120    +1     

☔ 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 enabled auto-merge (squash) June 5, 2025 01:05
@WilliamLiu1997
Copy link
Contributor Author

@microsoft-github-policy-service agree

@ArgoZhang ArgoZhang merged commit c234b76 into dotnetcore:main Jun 5, 2025
5 checks passed
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(SelectTree): add CanExpandWhenDisabled parameter

2 participants