Copilot commented on code in PR #38162:
URL: https://github.com/apache/superset/pull/38162#discussion_r2885406382
##########
superset-frontend/packages/superset-ui-core/src/components/DropdownContainer/DropdownContainer.tsx:
##########
@@ -314,7 +318,7 @@ export const DropdownContainer = forwardRef(
>
{notOverflowedItems.map(item => item.element)}
</div>
- {popoverContent && (
+ {shouldShowButton && (
<>
<Global
styles={css`
Review Comment:
`shouldShowButton` can be true while `popoverContent` is `null` (items
exist, nothing overflows, and `dropdownContent` is undefined). Since the
Popover is still rendered, clicking the button can open an empty popover
overlay. Consider rendering the button without the Popover wrapper when
`popoverContent` is null, or guarding Popover open/trigger so it can’t open
unless there is content to show.
##########
superset-frontend/packages/superset-ui-core/src/components/DropdownContainer/DropdownContainer.tsx:
##########
@@ -234,6 +234,10 @@ export const DropdownContainer = forwardRef(
const overflowingCount =
overflowingIndex !== -1 ? items.length - overflowingIndex : 0;
+ // Always show button when items exist to prevent layout shifts
+ // and ensure consistent UI even when nothing is currently overflowing
Review Comment:
The new inline comment uses time-specific wording (“currently overflowing”).
The repo’s guidance prefers timeless comments to avoid becoming outdated;
consider rephrasing to remove “currently” while keeping the intent.
```suggestion
// and ensure consistent UI even when no items are overflowing
```
--
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]