-
Notifications
You must be signed in to change notification settings - Fork 4k
Convert clearStaleNodes to ClearStaleNodesVisitor #12819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert clearStaleNodes to ClearStaleNodesVisitor #12819
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
✅ PR preview is ready!
|
dd70991 to
e17221a
Compare
beb1c33 to
e1bbf37
Compare
e17221a to
9fdebcf
Compare
e1bbf37 to
1528c16
Compare
📈 Frontend coverage change detectedThe frontend unit test (vitest) coverage has increased by 0.0100%
✅ Coverage change is within normal range. |
1528c16 to
eeb90b9
Compare
d094476 to
fbaecd5
Compare
eeb90b9 to
223aaf7
Compare
📉 Python coverage change detectedThe Python unit test coverage has decreased by 0.0000%
✅ Coverage change is within normal range. Coverage by files
|
f024af9 to
fd68cd0
Compare
9fe4523 to
9671db9
Compare
fd68cd0 to
00cafd3
Compare
9671db9 to
e358528
Compare
7199a10 to
807de2c
Compare
2e0ae39 to
8545204
Compare
4a7e699 to
d461b5e
Compare
8545204 to
0f55447
Compare
d461b5e to
96fe649
Compare
0f55447 to
761928f
Compare
f582a47 to
be4990a
Compare
There was a problem hiding this 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 refactors the stale node clearing logic from instance methods on AppNode/BlockNode/ElementNode to a dedicated visitor pattern implementation (ClearStaleNodeVisitor). This improves code organization by consolidating tree traversal logic into visitor classes following an established pattern in the codebase.
Key changes:
- Extracted
clearStaleNodesmethod logic into a newClearStaleNodeVisitorclass - Removed
clearStaleNodesmethods fromAppNodeinterface,BlockNode, andElementNode - Updated
AppRoot.clearStaleNodesto use the new visitor pattern - Added comprehensive test coverage for the new visitor
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
ClearStaleNodeVisitor.ts |
New visitor class implementing stale node clearing logic previously embedded in node classes |
ClearStaleNodeVisitor.test.ts |
Comprehensive test suite for the new visitor with unit and integration tests |
ElementNode.ts |
Removed clearStaleNodes method in favor of visitor pattern |
BlockNode.ts |
Removed clearStaleNodes method and unused import |
AppRoot.ts |
Updated to use ClearStaleNodeVisitor instead of calling node methods directly |
AppRoot.test.ts |
Added tests verifying visitor integration and moved existing tests under proper nesting |
AppNode.interface.ts |
Removed clearStaleNodes method from interface |
be4990a to
cd5b495
Compare
cd5b495 to
cbd79fb
Compare
cbd79fb to
fe82e1a
Compare

Describe your changes
Migrates the
clearStaleNodesmethod to the Clear Stale Nodes VisitorTesting Plan
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.