bito-code-review[bot] commented on PR #42529:
URL: https://github.com/apache/superset/pull/42529#issuecomment-5101528169

   <!-- Bito Reply -->
   The flagged issue is correct. Using `path.startsWith('/dataset')` is overly 
broad because it matches any path beginning with that string, including 
`/datasets` or `/datasetting`, which are not intended to trigger the Datasets 
tab highlight.
   
   To resolve this, you should ensure the check matches only the exact path or 
a path followed by a slash. You can update the condition to check if the path 
is exactly `/dataset` or starts with `/dataset/`:
   
   ```typescript
   case path.startsWith(Paths.Datasets) || path === Paths.Dataset || 
path.startsWith(`${Paths.Dataset}/`):
   ```
   
   This ensures that only routes starting with `/dataset/` or the exact 
`/dataset` path trigger the active state for the Datasets tab.
   
   **superset-frontend/src/features/home/Menu.tsx**
   ```
   case path.startsWith(Paths.Datasets) || path === Paths.Dataset || 
path.startsWith(`${Paths.Dataset}/`):
           setActiveTabs([MenuKeys.Datasets]);
           break;
   ```


-- 
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]

Reply via email to