Files
angular/devtools/projects
Shuaib Hasan Akib d60ee5e27b refactor(devtools): replace deprecated tree APIs in the component tree
`FlatTreeControl` from `@angular/cdk/tree` and `MatTreeFlattener` from
`@angular/material/tree` are deprecated in favor of the tree's
`levelAccessor`/`childrenAccessor` APIs.

The component tree (directive forest) isn't rendered with a CDK tree but
as a flat list in a virtual scroll viewport. It only used
`FlatTreeControl` to track which nodes are expanded, and
`MatTreeFlattener` to flatten the forest and compute the visible nodes.

Replace them with:
- An `ExpansionModel` that tracks expanded nodes with a
  `SelectionModel`, like `FlatTreeControl` did internally, and exposes
  the `expand`, `collapse`, `toggle`, `isExpanded` and `changed` members
  used by devtools.
- Local helpers in `ComponentDataSource` that flatten the forest in
  depth-first order and return the nodes whose ancestors are all
  expanded, matching the previous behavior.

Also add a spec covering which nodes are visible as nodes are expanded
and collapsed.
2026-10-02 10:59:10 -04:00
..