korbit-ai[bot] commented on code in PR #33762:
URL: https://github.com/apache/superset/pull/33762#discussion_r2143408517
##########
superset-frontend/src/dashboard/components/PropertiesModal/index.tsx:
##########
@@ -592,6 +592,10 @@ const PropertiesModal = ({
setTags(parsedTags);
};
+ const handleClearTags = () => {
+ setTags([]);
+ };
Review Comment:
### Clear Tags Operation Requires Explicit Save <sub></sub>
<details>
<summary>Tell me more</summary>
###### What is the issue?
The `handleClearTags` function doesn't trigger a server-side update. It only
updates the local state, which means the tags aren't actually cleared in the
database until the user clicks Save/Apply.
###### Why this matters
Users may expect tags to be cleared immediately when using the clear button,
and be confused when they need to explicitly save to persist the changes.
###### Suggested change ∙ *Feature Preview*
Consider adding a warning or visual indicator that changes need to be saved,
or modify the code to auto-save when tags are cleared:
```typescript
const handleClearTags = async () => {
setTags([]);
if (!onlyApply) {
await SupersetClient.put({
endpoint: `/api/v1/dashboard/${dashboardId}`,
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
tags: [],
}),
});
addSuccessToast(t('Tags cleared successfully'));
}
};
```
###### Provide feedback to improve future suggestions
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/0b60d673-49f2-4d06-a5ef-4f30f1331532/upvote)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/0b60d673-49f2-4d06-a5ef-4f30f1331532?what_not_true=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/0b60d673-49f2-4d06-a5ef-4f30f1331532?what_out_of_scope=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/0b60d673-49f2-4d06-a5ef-4f30f1331532?what_not_in_standard=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/0b60d673-49f2-4d06-a5ef-4f30f1331532)
</details>
<sub>
💬 Looking for more details? Reply to this comment to chat with Korbit.
</sub>
<!--- korbi internal id:86fd39ef-0ab8-40a3-9862-2b92a524aebb -->
[](86fd39ef-0ab8-40a3-9862-2b92a524aebb)
--
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]