daffodil icon indicating copy to clipboard operation
daffodil copied to clipboard

Duplicate track keys in `DaffTreeComponent`

Open xelaint opened this issue 3 months ago • 4 comments

Is this a regression?

  • [ ] Yes, this behavior used to work in the previous version

Description

Duplicate track keys in DaffTreeComponent.

The provided track expression resulted in duplicated keys for a given collection. Adjust the tracking expression such that it uniquely identifies all the items in the collection.

trackByTreeElement is resulting in duplicated keys. Using el.title might not be the best since there could be duplicate titles (e.g. Overview)

Environment

  • Daffodil version: 0.90
  • Angular version: 20
  • Browser(s):
  • Node version: run node --version
  • Operating system:

Steps to reproduce

Steps to reproduce:

  1. Run a watch on design (npx nx run @daffodil/design:build --watch)
  2. Run serve npx ng s daffio
  3. Convert *ngFor="let node of flatTree; trackBy: trackByTreeElement" to @for expression
  4. See in console the warnings

Expected behavior

trackByTreeElement should result in all unique keys

Actual behavior

The provided track expression resulted in duplicated keys for a given collection. Adjust the tracking expression such that it uniquely identifies all the items in the collection.

Additional context

No response

xelaint avatar Oct 07 '25 17:10 xelaint

Hello @xelaint ! recently discovered this repository , would love to work on this issue. will try fixing this bug within 2-3 days or earlier if assigned.

Cheers, Dibby

F4tal1t avatar Oct 07 '25 18:10 F4tal1t

@damienwebdev @griest024 @F4tal1t Seems like the update in #4115 did not fix this issue. I'm still seeing the warning in console in my local environment.

xelaint avatar Oct 14 '25 22:10 xelaint

@damienwebdev @griest024 @F4tal1t Seems like the update in #4115 did not fix this issue. I'm still seeing the warning in console in my local environment.

hm, node.id should be unique right?

griest024 avatar Oct 14 '25 22:10 griest024

@griest024 I'm seeing it in design-land. Not sure if it a tree component issue or design-land implementation issue.

xelaint avatar Oct 15 '25 13:10 xelaint