-
Notifications
You must be signed in to change notification settings - Fork 523
feat(kit): support manual toggle item node in tree #11321
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
base: main
Are you sure you want to change the base?
Conversation
Failed tests ❌Before (main) ← Diff → After (local)(updated for commit af70062) |
View your CI Pipeline Execution ↗ for commit af70062
☁️ Nx Cloud last updated this comment at |
598a5bc
to
2fbcffd
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 adds manual control over expanding and collapsing tree items and updates demo examples to showcase the new toggle and dynamic-add functionality.
- Introduces a
toggle(item: TuiTreeItem)
method on the tree-item component - Moves expand/collapse handling into a host click listener in the content component
- Updates demo examples 5 and 6 to use the new toggle API and add-item behavior
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
tree-item.component.ts | Added public toggle(item: TuiTreeItem) method |
tree-item-content.template.html | Removed individual (click) on expand button |
tree-item-content.component.ts | Added host (click) listener and onClick handler (with log) |
examples/6/index.ts | Updated imports, handler, onChecked , and new add method |
examples/6/index.less | Styled flat button opacity on hover |
examples/6/index.html | Switched to let-treeItem , let-treeNode , and added add button |
examples/5/index.ts | Added TuiButton , new add method, input type for TuiTreeItem |
examples/5/index.less | Added flat button hover styles |
examples/5/index.html | Updated template to use let-treeItem , let-treeNode , add button |
examples/5/content.ts | Removed leftover host click override |
Comments suppressed due to low confidence (1)
projects/kit/components/tree/components/tree-item/tree-item.component.ts:98
- [nitpick] The
toggle
method requires its own instance as a parameter. Consider converting this to an instance method without parameters (toggle(): void
) to simplify the API (this.toggle()
toggles itself).
public toggle(item: TuiTreeItem): void {
projects/kit/components/tree/components/tree-item-content/tree-item-content.component.ts
Outdated
Show resolved
Hide resolved
projects/kit/components/tree/components/tree-item-content/tree-item-content.component.ts
Show resolved
Hide resolved
da0bbfa
to
22f2c76
Compare
Visit the preview URL for this PR (updated for commit af70062): https://taiga-previews-demo--pr11321-splincode-feat-issues-111-m2cacihv.web.app (expires Fri, 25 Jul 2025 07:52:29 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 73dddc3c665194f3e11f18c16aeb71af4c289c37 |
BundleMonFiles updated (2)
Unchanged files (3)
Total files change +40B +0.01% Groups updated (1)
Final result: ✅ View report in BundleMon website ➡️ |
Playwright test resultsDetails
Skipped testschromium › tests/addon-mobile/mobile-dropdown/mobile-dropdown-with-textfield.pw.spec.ts › DropdownMobile for textfields › with legacy select |
782e576
to
5494dde
Compare
5494dde
to
af70062
Compare
margin-inline-start: auto; | ||
} | ||
|
||
::ng-deep tui-tree-item > *:hover > [appearance='flat'] { |
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.
it looks cumbersome, can we simplify it somehow and avoid using ng-deep?
Fixes #11120