bito-code-review[bot] commented on code in PR #38909:
URL: https://github.com/apache/superset/pull/38909#discussion_r3000708579
##########
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/ConfigModalContent/ConfigModalContent.tsx:
##########
@@ -105,6 +106,28 @@ function ConfigModalContent({
isChartCustomizationId(currentItemId) &&
chartCustomizationIds.includes(currentItemId);
+ const hasNoItems =
+ filterState.orderedIds.length === 0 &&
+ customizationState.orderedIds.length === 0;
+ const showEmptyState = hasNoItems || !currentItemId;
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Incorrect empty state condition</b></div>
<div id="fix">
The showEmptyState logic incorrectly triggers the empty state when no item
is selected (currentItemId is empty), even if filters or customizations exist.
This displays a misleading message about creating new elements when items are
already present. It should only show when hasNoItems is true, reverting to the
original behavior of displaying nothing when items exist but none are selected.
</div>
<details>
<summary>
<b>Code suggestion</b>
</summary>
<blockquote>Check the AI-generated fix before applying</blockquote>
<div id="code">
````suggestion
const showEmptyState = hasNoItems;
````
</div>
</details>
</div>
<small><i>Code Review Run #163513</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
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]