修正当激活指定子节点时,对应父节点应全部展开#8186
Open
Tony-ST0754 wants to merge 3 commits into
Open
Conversation
refactor: 重构展开逻辑,当激活指定子节点时,应全部展开
|
Thanks for your PR, @Tony-ST0754. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRefactors the expand-state handling so that when a node is marked as expanded, it is no longer forcibly re-collapsed based on the collapsed cache, aligning behavior with "expand all when activating a specified child node". Sequence diagram for updated node expansion logic in CheckExpandAsyncsequenceDiagram
participant TreeComponent
participant ExpandableNodeCache
participant CollapsedNodeCache
participant ExpandedNodeCache
TreeComponent->>ExpandableNodeCache: CheckExpandAsync(node, expandCallback)
alt node.IsExpand is true
ExpandableNodeCache->>ExpandedNodeCache: Add(node.Value)
note over ExpandableNodeCache,CollapsedNodeCache: CollapsedNodeCache.Contains no longer called
else node.IsExpand is false
note over ExpandableNodeCache: No change to caches
end
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- With the removal of the collapsed-state check, a node can now be present in both ExpandedNodeCache and CollapsedNodeCache; consider ensuring these caches remain mutually exclusive (e.g., removing from CollapsedNodeCache when adding to ExpandedNodeCache) to avoid conflicting state.
- It may be helpful to add a short comment near CheckExpandAsync explaining the intended interaction between IsExpand, ExpandedNodeCache, and CollapsedNodeCache, since the behavior when toggling expansion is now less obvious from the code alone.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- With the removal of the collapsed-state check, a node can now be present in both ExpandedNodeCache and CollapsedNodeCache; consider ensuring these caches remain mutually exclusive (e.g., removing from CollapsedNodeCache when adding to ExpandedNodeCache) to avoid conflicting state.
- It may be helpful to add a short comment near CheckExpandAsync explaining the intended interaction between IsExpand, ExpandedNodeCache, and CollapsedNodeCache, since the behavior when toggling expansion is now less obvious from the code alone.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
refactor:由于逻辑改变,默认存在子节点时,父节点全部展开,此时数量要将子节点数也要包括在内
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8186 +/- ##
==========================================
- Coverage 98.78% 98.78% -0.01%
==========================================
Files 766 766
Lines 34221 34217 -4
Branches 4699 4698 -1
==========================================
- Hits 33806 33802 -4
Partials 415 415
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
refactor: 重构展开逻辑,当激活指定子节点时,对应父节点应全部展开
Link issues
fixes #8185
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Adjust node expansion behavior so that activating a specified child node results in it being treated consistently as expanded rather than reverting to a collapsed state.
Bug Fixes:
Enhancements: