bito-code-review[bot] commented on code in PR #36882:
URL: https://github.com/apache/superset/pull/36882#discussion_r2659857187
##########
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx:
##########
@@ -395,22 +395,36 @@ const FilterBar: FC<FiltersBarProps> = ({
]);
const handleClearAll = useCallback(() => {
+ dispatch(logEvent(LOG_ACTIONS_CHANGE_DASHBOARD_FILTER, {}));
+ setUpdateKey(1);
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>State Update Logic Bug</b></div>
<div id="fix">
This change sets `updateKey` to a fixed value instead of incrementing it. In
React, setting state to the same value doesn't trigger a re-render or effect.
If `handleClearAll` is called multiple times without an intervening
`handleApply` (which also sets to 1), subsequent calls won't update the URL
parameters because the `useEffect` dependency on `updateKey` won't change.
Revert to incrementing to ensure reliable triggering.
</div>
</div>
<small><i>Code Review Run #07c9f8</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]