Skip to content

fix(module:tree): read initial state of nzNodes#9380

Open
rajniszp wants to merge 3 commits into
NG-ZORRO:masterfrom
rajniszp:initTree-PR
Open

fix(module:tree): read initial state of nzNodes#9380
rajniszp wants to merge 3 commits into
NG-ZORRO:masterfrom
rajniszp:initTree-PR

Conversation

@rajniszp

@rajniszp rajniszp commented Sep 3, 2025

Copy link
Copy Markdown

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Application (the showcase website) / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Node state (isExpanded, isSelected, isChecked, isHalfChecked, isMatched) is ignored when updating nodes/loading children

Issue Number: N/A

What is the new behavior?

Node state is correctly set and thus represented on the UI

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@codecov

codecov Bot commented Sep 3, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.21%. Comparing base (4eb7420) to head (50fd439).
⚠️ Report is 260 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9380      +/-   ##
==========================================
- Coverage   92.27%   90.21%   -2.07%     
==========================================
  Files         560      573      +13     
  Lines       19708    23711    +4003     
  Branches     3025     4791    +1766     
==========================================
+ Hits        18185    21390    +3205     
- Misses       1191     1503     +312     
- Partials      332      818     +486     

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

read state recursively (including all descendant nodes)

@Nicoss54 Nicoss54 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could you had some test please

getting half-checked nodes from checked nodes, setting matchedNodeList not needed (no "matched" in NzTreeNodeOptions); added tests
@rajniszp

Copy link
Copy Markdown
Author

Added tests analogous to existing ones
(failed CodeFactor check highlights lines that I did not change)

@rajniszp rajniszp requested a review from Nicoss54 January 21, 2026 18:24
@rajniszp

Copy link
Copy Markdown
Author

Hi, any chance to merge?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants