quick ci of tree #4446
Merged
damienwebdev merged 4 commits intodevelopfrom Apr 17, 2026
Merged
Conversation
8f60a3f to
35edbd8
Compare
) After f32fa78 split the docs routes into separate design and storefront subtrees, the `index` resolver now lives on the section-level parent route while `useDaffioNavList` is invoked from components mounted on child route segments. Angular's `ActivatedRoute.data` only exposes the current segment's data, so `data.index` was `undefined` and the old composable leaked `undefined` through to consumers (it lacked a `filter(Boolean)` after the `map`). Switching to `DaffRouterDataService.data$` reads the merged data of the entire activated route tree, so the ancestor-resolved `index` is visible regardless of which segment the consumer lives on. An added trailing `filter(Boolean)` also guards against the brief window where the merged data object emits before `index` has been resolved.
The `distinctUntilChanged()` applied to the `combineLatest` tuple in `DaffioSidebarService.activeRegistration$` was a no-op — each upstream emission produces a new array, so reference equality never dedupes. Every route-data re-emission therefore forwarded a (possibly identical) registration downstream, causing subscribers to react to router changes even when the active sidebar hadn't changed. Move the operator after the `map` and compare by `registration.id` so the stream only emits when the sidebar registration actually changes
This also brings three new features: - Node IDs are now scoped to each tree instance: ids are composed as `<treeId>.<id>` down the ancestor chain. - `DaffTreeComponent` exposes an `id` input with an auto-incrementing fallback so multiple trees on the same page nlonger collide on element IDs. - When a tree item becomes `selected`, the item opens its full ancestor chain via the new `daffTreeOpenAncestors` helper and notifies the tree to re-flatten, so selected items are revealed without consumers having to call `open` manually. BREAKING CHANGE: `DaffTreeComponent` and `DaffTreeItemDirective` now expose their inputs (`tree`, `renderMode`, `node`, `selected`), content queries (`withChildrenTemplate`, `treeItemTemplate`), and the public `flatTree` field as signals rather than plain properties. Template bindings (`[tree]="data"`) continue to work, but any programmatic reads must invoke the signal: `component.flatTree` → `component.flatTree()`, `component.tree` → `component.tree()`,`directive.node` → `directive.node()`, and so on. Consumers that read these fields from tests or component code must update accordingly.
35edbd8 to
03cfe38
Compare
1 task
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.
This is just a test run of #4408 before merge as there were slight adjustments.