Skip to content

Commit 0a737dc

Browse files
cursor[bot]cursoragentraymondjacobson
authored
Fix track overflow menu showing delete action in playlist edit context (#14098)
## Summary - hide `Delete Track` from the track overflow menu when the menu is being used in collection page remove-flow context (`onRemove` present) - keep `Delete Track` available in other contexts ## Root Cause - the table overflow menu for collection pages injects a contextual "Remove from this playlist/album" item, but still relied on `TrackMenu` default `includeDelete=true` - this caused owners to see both remove and delete in the same menu, making accidental destructive deletes possible ## Testing - attempted focused web test run: `npm run -w packages/web test -- --runInBand OverflowMenuButton` - environment limitation: `vitest: not found` in this workspace <div><a href="https://cursor.com/agents/bc-4f76c0ca-43e3-5b6e-b530-cc675a842cbd"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/automations/c63aa103-66df-4558-b31d-675358e5c6a1"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/view-automation-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/view-automation-light.png"><img alt="View Automation" width="141" height="28" src="https://cursor.com/assets/images/view-automation-dark.png"></picture></a>&nbsp;</div> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Ray Jacobson <raymondjacobson@users.noreply.github.com>
1 parent 45ce680 commit 0a737dc

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

packages/web/src/components/table/components/OverflowMenuButton.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,13 @@ export const OverflowMenuButton = (props: OverflowMenuButtonProps) => {
3030
uid,
3131
...other
3232
} = props
33-
const { includeEdit = true, isFavorited, isOwnerDeactivated, trackId } = other
33+
const {
34+
includeDelete = true,
35+
includeEdit = true,
36+
isFavorited,
37+
isOwnerDeactivated,
38+
trackId
39+
} = other
3440

3541
const removeMenuItem = {
3642
text: removeText,
@@ -45,6 +51,7 @@ export const OverflowMenuButton = (props: OverflowMenuButtonProps) => {
4551
...other,
4652
type: 'track' as const,
4753
mount: 'page',
54+
includeDelete: onRemove ? false : includeDelete,
4855
includeEdit,
4956
extraMenuItems: onRemove ? [removeMenuItem] : []
5057
}

0 commit comments

Comments
 (0)