bito-code-review[bot] commented on code in PR #35945:
URL: https://github.com/apache/superset/pull/35945#discussion_r2485044222
##########
superset-frontend/src/views/CRUD/utils.tsx:
##########
@@ -324,16 +326,18 @@ export function handleDashboardDelete(
desc: true,
},
],
- filters: [
- {
- id: 'owners',
- operator: 'rel_m_m',
- value: `${userId}`,
- },
- ],
+ filters:
+ dashboardFilter === 'Mine'
+ ? [
+ {
+ id: 'owners',
+ operator: 'rel_m_m',
+ value: `${userId}`,
+ },
+ ]
+ : [],
};
- if (dashboardFilter === 'Mine') refreshData(filters);
- else refreshData();
+ refreshData(filters);
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Incorrect refresh filter handling in chart
delete</b></div>
<div id="fix">
The refresh logic after chart deletion now passes a new filters object with
conditional 'Mine' filters, which overrides and clears any additional
user-applied filters (e.g., by type, owner, or other criteria) instead of
preserving the current filter state. This breaks the expected behavior where
deleting an item should refresh the list with the same filters intact. The
`refreshData()` call should be used without arguments to maintain the last
fetch configuration, including all active filters.
</div>
<details>
<summary>
<b>Code suggestion</b>
</summary>
<blockquote>Check the AI-generated fix before applying</blockquote>
<div id="code">
````suggestion
refreshData();
````
</div>
</details>
</div>
<small><i>Code Review Run <a
href=https://github.com/apache/superset/pull/35945#issuecomment-3478403284>#67bcca</a></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
##########
superset-frontend/src/views/CRUD/utils.tsx:
##########
@@ -324,16 +326,18 @@ export function handleDashboardDelete(
desc: true,
},
],
- filters: [
- {
- id: 'owners',
- operator: 'rel_m_m',
- value: `${userId}`,
- },
- ],
+ filters:
+ dashboardFilter === 'Mine'
+ ? [
+ {
+ id: 'owners',
+ operator: 'rel_m_m',
+ value: `${userId}`,
+ },
+ ]
+ : [],
};
- if (dashboardFilter === 'Mine') refreshData(filters);
- else refreshData();
+ refreshData(filters);
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Incorrect refresh filter handling in dashboard
delete</b></div>
<div id="fix">
Similar to the chart deletion issue, the dashboard deletion refresh now
passes a new filters object that clears any additional user-applied filters
instead of preserving the current filter state. This inconsistency affects both
chart and dashboard lists, where deletion should maintain the active filters.
Use `refreshData()` without arguments to keep the last configuration.
</div>
<details>
<summary>
<b>Code suggestion</b>
</summary>
<blockquote>Check the AI-generated fix before applying</blockquote>
<div id="code">
````suggestion
refreshData();
````
</div>
</details>
</div>
<small><i>Code Review Run <a
href=https://github.com/apache/superset/pull/35945#issuecomment-3478403284>#67bcca</a></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]