bito-code-review[bot] commented on PR #41183:
URL: https://github.com/apache/superset/pull/41183#issuecomment-4738479255
<!-- Bito Reply -->
The flagged issue regarding key collisions in the navigation menu is
correct. Using `name ?? label` as the key causes a collision when a parent menu
item's `name` matches a child item's `label` (e.g., 'SQL Lab').
To resolve this, you should ensure keys are unique by namespacing them, for
example by incorporating the parent's name or a unique identifier into the
child's key. In `superset-frontend/src/features/home/Menu.tsx`, you can update
the `buildMenuItem` function to generate a unique key for children, such as
`key: parentName ? `${parentName}-${key}` : key`.
I have checked the other comments on this PR, and there are no additional
actionable review comments to address. Would you like me to proceed with
implementing this fix in `Menu.tsx`?
**superset-frontend/src/features/home/Menu.tsx**
```
}: MenuObjectProps): MenuItem => {
// Key items by the stable FAB `name` so active-tab matching is
independent
// of the localized label. Fall back to the label when no name is
provided.
const key = name ?? label;
if (url && isFrontendRoute) {
return {
key: parentName ? `${parentName}-${key}` : key,
label: (
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]